Reputation: 13448
Can I have subgroups routing in Laravel 4 like this:
Route::group(['before' => 'admin'], function()
{
Route::get('/','AdminController@index');
Route::group(['before' => 'rootOnly'], function()
{
Route::get('/root', 'RootController@rootOnlyTask');
}
});
Is there a way to achieve something like that?
Tks
Upvotes: 1
Views: 522
Reputation: 3668
yes you can do that..but for route /root
it will check for both before methods. Whenever you access /root
it will first check if admin
is true then it will go for rootOnly
Upvotes: 1