Support the ongoing development of Laravel.io →
Authentication Requests
Last updated 2 years ago.
0

Do you have a pivot table that contains the admin roles or does each user row have an admin column? Need more information.

Last updated 2 years ago.
0

alexhackney said:

Do you have a pivot table that contains the admin roles or does each user row have an admin column? Need more information.

Yes I'm sorry: this is a users structure table:

id (auto_increment); username (varchar); password (varchar); level (enum ('Admin', 'Editor', 'User'); [other]

Last updated 2 years ago.
0

your the logic is wrong.

if user is authenticaded and if level not a 'user', the next instrucion code is the line 11.

replate filter by http://laravel.io/bin/522R

Last updated 2 years ago.
0

mapb1990 said:

your the logic is wrong.

if user is authenticaded and if level not a 'user', the next instrucion code is the line 11.

replate filter by http://laravel.io/bin/522R

I've copied your code, but filter doens't work.... user can use the admin panel :-|

Last updated 2 years ago.
0

This solution work perfectly :D

Route::group(array('prefix' => 'admin', 'before' => 'isAdmin'), function() { Route::get('home', 'AdminController@home')); Route::get('/', 'AdminController@home'); });

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

AsoStrife asostrife Joined 9 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.