jeudi 17 décembre 2015

Authorization along with Authentication in Route.php : Laravel 5.1

I have below Route that checks if the user is authenticated and only then let them to access the page

<?php
Route::group([
    'middleware' => 'auth',
], function() {

    Route::get('/Categories-List', 'Skills\Category_Controller@index');
});

In my auth()->user(), there is RoleID to check if the user is Admin or with other role. I want to check if the RoleID is 1 then only let them to access the page.

Can I set Authorization along with Authentication in Laravel 5.1



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire