controller grouping
Route::controller($param, $action);
// grouping the common controller
// dont write same controller repeatedly
Route::controller(['WelcomeController'], function () {
// you can set the controller method as string
Route::get('/settings', 'settings');
// you can also set the controller method as array
Route::get('/settings/add', ['create']);
// you can also add middleware auth to a grouped controller
// if there's no global middleware set in the parent
Route::get('/settings/add', ['create', ['auth']]);
});Last updated