lundi 27 juin 2016

Restricting routes with auth middleware group in laravel 5.2

I'm trying to prevent people from access 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'
    ]);
});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28ZdWmR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire