Multiple Panels, 1 Login Screen
Hi, I am building filament v3 app that has multiple panels.
Instead of having different login urls, i want to have 1 login url, and based on the user_type (stored in the users table) it needs to redirect to the correct panel.
I tried creating a seperate panel, which seems to kind of work, but I cant get the redirection to work. Anyone that can push me into the right direction? Or is there a better practice?
I tried overriding the LoginResponse with a custom one. But also doesnt seem to work.
5 Replies
I would like to know also 😎
@jabs @GavTheDev
I have a setup like this, and use below code.
Don't think it is the best code solution, but it works for me till i see a better method for doing this.
Helper Function
Default Panel (also login panel)
Other Panel.
Admin Panel.
Class LoginResponse
Main Route
Top! @Tieme
And the logic for your own
canAccessPanel
in de model.
I know it works with Tenacy on the main panel, dont know if this works if you have tenacy on the other panels.
Als if you have acces to multiple panels, i use the plugin https://filamentphp.com/plugins/bezhansalleh-panel-switch to add a button so you can switch between them without changing the url.Thank you @Tieme !