Answer the question
In order to leave comments, you need to log in
Grouping routes in Laravel?
Good afternoon.
There is a routing:
Route::group(['prefix' => 'admin'], function()
{
$loginController = 'AdminAuthController';
Route::get('login', [
'as' => 'admin.login',
'uses' => $loginController.'@login'
]);
Route::post('login', [
'uses' => $loginController.'@postLogin'
]);
Route::get('logout', [
'as' => 'admin.logout',
'uses' => $loginController.'@logout'
]);
Route::group(['before' => 'admin_auth'], function()
{
Route::get('users', ['as' => 'admin.users', function()
{
return 'users';
}]);
Route::get('/', ['as' => 'home', function()
{
return View::make('hello');
}]);
});
});
Route::get('/', ['as' => 'home', function()
{
return View::make('hello');
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question