F
Filamentβ€’11mo ago
wyChoong

Panels visibility

I have this use case where I would want to setup the panels in such way: 1) have multiple panels but not all users should see all the panels 2) when login, they should use /login instead of /{panel}/login, it will bring them to panel they have access after login what api can I use to configure?
11 Replies
wyChoong
wyChoongβ€’11mo ago
bump this just in case it was push too far down for anyone to notice it...
awcodes
awcodesβ€’11mo ago
How would you know which panel to send them to if they can access multiple panels? obviously, you'd need a custom middleware, but still
wyChoong
wyChoongβ€’11mo ago
Probably maintain a table to control, but assume I have a source or logic to control, how would I set it in a middleware? @awcodes it would be something certain role can access specific panels, and after login it will first point them to the last panel they accessed like $user->last_panel
Dennis Koch
Dennis Kochβ€’11mo ago
I'd overwrite the login response and redirect them there.
awcodes
awcodesβ€’11mo ago
He's trying to have one centralized login though, instead of per panel login.
Dennis Koch
Dennis Kochβ€’11mo ago
Yeah, noticed that after sending πŸ˜…
wyChoong
wyChoongβ€’11mo ago
I did think this centralized login is the easy part of my question πŸ˜‚
awcodes
awcodesβ€’11mo ago
would a panel even work if it doesn't have ->login() and the user is authenticated somewhere else? i would think it would. but haven't tried it.
Dennis Koch
Dennis Kochβ€’11mo ago
You could register your own route and copy Login::class as a baseline
awcodes
awcodesβ€’11mo ago
as long as they are authenticated, i would think the panel wouldn't care how they logged in
wyChoong
wyChoongβ€’11mo ago
Yeah will try this login