Have two different authentications
Hi there,
I am creating a new system for one of my clients, and I am using Filament for the admin dashboard to manage everything.
However, there will also be a user area where users can login. The users and admins are the same table, despite of the is_admin field that would be true or false.
I am wondering if it is possible to have a second authentication aside of Filament. I installed Laravel UI (I know its deprecated, but it works), but when I try to login it just redirects back to the login page.
Anyone already made something likes this, or does someone know where to start?
3 Replies
You can override the Login class and add your implementation. Each panel can have its own implementation, or you can make one implementation that suffices both.
https://beta.filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features
create Admin model with global scope to
user.is_admin = true
, configure laravel auth guard, then set panel ->authGuard('admin')
?Allright, thanks. How would this be done in v2?
Ah whatever, I will just upgrade to v3 anyways and then try it
Thanks for the answers