Skip to content
Advertisement

multiple authentications on laravel

I have built in laravel an authentication system on user table. I have to make two login pages for admin and normal user on same users table. I have use spatie roles and permission but it does not stop admin login from normal user login page and vice versa.

I have add checkmaster middleware just for accepting my question on stackoverflow.

JavaScript

Advertisement

Answer

The middleware is working only when user try to go in certain route.

Therefore, the middleware CheckMaster only takes place when logon user tried to go in certain route.

If you are implementing with AuthLoginController.php, you can override the function authenticated when user is authenticated, example code:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement