jeudi 16 juin 2016

Laravel 5.2 assigning same route to different controller action by conditions

I wish to route the same route to different controller base on user type.

Such as

    if (Auth::check() && Auth::user()->is_admin) {
        Route::get('/profile', 'AdminController@show');
    } elseif (Auth::check() && Auth::user()->is_superadmin) {
        Route::get('/profile', 'SuperAdminController@show');
    }

But this doesn't work.

How can I make it works as what I want?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire