#is it possible to use single login page to redirect to their own panel based on role?
15 messages · Page 1 of 1 (latest)
Middleware is where you would want to handle this. But you’ll need to look into unifying the authentication of filament since panels are scoped to their own login routes out of the box. But it can be done.
i dont know if anyone ever unifying the auth of filament before. but is there a guide in the documentation?
There’s not a guide because it’s not really a filament concept but more of a laravel concept.
Filament defaults to the Laravel authentication process.
i see, but i really dont understand, i guess ill just add index homepage where there will button for each role login page
A middleware will have the authenticated user meaning you can check their roles/permissions and issue a redirect to the appropriate panel.
But you’ll need to include that middleware on each panel provider.
Sorry if out of topic but for filament do you reccomend using filament shield plugin or spatie permission , im so confused about the difference beteween the two
I have a different approach for that https://github.com/filamentphp/filament/discussions/14280
You can try both and decide which is best for your project.
@light dirge @zenith harness thank you for teaching me a newbie in this tech filed and God bless (story time ,,actually im an intern in a pharma company and they told me to build an intern management app by myself in 3 months 🥹 )
good luck ✌️
I was looking for the same functionality and came accross this video
https://www.youtube.com/watch?v=9hRgCjDQDGw
Goes throught the solution in a bit more detail but at the core it uses @light dirge method of creating a CustomLoginResponse class
A 2-in-1 example of implementing roles: in the same panel or in separate panels? Also, building a common login form or not?
- Source for single panel: https://filamentexamples.com/project/filament-roles-in-sign-up-and-different-resources
- Source for multiple panels: https://filamentexamples.com/project/filament-roles-with-multiple-panels
- Ori...
yep, same approach