lundi 27 juin 2016

Restricting routes with auth middleware group in laravel 5.2

I'm trying to prevent people from accessing the /dashboard route unless they're authenticated(logged in). I looked at the laravel docs and here's what I thought I was supposed to do to accomplish this. Although I'm pretty sure I don't need the 'middleware' => 'auth' line in the dashboard route.

Route::group(['middleware' => 'auth'], function (){
    Route::get('/dashboard', [
        'uses' => 'UserController@getDashboard',
        'as' => 'dashboard',
        'middleware' => 'auth'
    ]);
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire