Search code examples
phplaravelframeworkslaravel-5.3laravel-routing

Groups in group on routing Laravel


I really need help!

On the Laravel 5.3, it seems that a group of routes into an another group isn't working for me. Is there any solution to make it work ? Or do I have to write my routes in another way ? This is the way I write my routes:

Route::group([
'prefix' => LaravelLocalization::setLocale(),
'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]
],
function()
{
Route::group([
        'prefix' => 'admin'
    ], function () {

    // General Settings
    Route::get('settings', [
        'as' => 'admin.settings',
        'uses' => 'AdminController@showSettings'
    ]);
});

});

I am using a prefix in the first group for the multiple language and the another group is for the admin section. I want an url like this : /en/admin/settings


Solution

  • The problem is solved! It did not work because I had used another route in which there was an paramater before the group of admin section ex:

    Route::get('activate/{code}', [
        'as' => 'auth.activation',
        'uses' => 'RegistrationController@getActivate'
    ]);