#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
Then specify a 'roles' middleware on the route you'd like to protect, and specify the individual roles as an array:
Route::get('user/{user}', [
'middleware' => ['auth', 'roles'],
'uses' => 'UserController@index',
'roles' => ['administrator', 'manager']
]);
If you found this ACL manager helpful please give this repo a star, and give me a follow. Any questions, please leave a comment.
Update:
I solved my issue. by adding this codes in app\Exceptions\Handler.php @ unauthenticated function:
Now its working :)
Hi
I used your tutorial and every thing is OK.
i built admin layouts as separate theme, when I write in url: (http://multiauth.dev/admin) (and not logged) it redirect me to original login.
I need to redirect me to (http://multiauth.dev/admin/login).
i have a note if logged to admin i can see (http://multiauth.dev/admin/login) page.
How i can do it?
note: I'm newbie with laravel