F
Filament12mo ago
Abi

How to show a different Filament Panel based on the user role?

I am using Spatie's Laravel Permission. Is there a way to show a different Filament Panel based on the user role?
Solution:
I think with the current implementation you always need to have two urls. Like /admin and /client. Then you can add the guard for those users or use canAccessPanel()
Jump to solution
6 Replies
Dennis Koch
Dennis Koch12mo ago
Just use the canAccessPanel() method to limit the panel. Or do you want to swap them based on the role? Not sure whether there is an easy way to do that.
Abi
AbiOP12mo ago
i have 2 panel and I want to show one based on the role Admin -> Show default Panel Customer -> Show Customer Panel
Solution
Dennis Koch
Dennis Koch12mo ago
I think with the current implementation you always need to have two urls. Like /admin and /client. Then you can add the guard for those users or use canAccessPanel()
Abi
AbiOP12mo ago
can I still use the same filament login page?
Dennis Koch
Dennis Koch12mo ago
Shouldn't be an issue
Abi
AbiOP12mo ago
ok, let me try
Want results from more Discord servers?
Add your server