F
Filament15mo 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 Koch15mo 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
AbiOP15mo 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 Koch15mo 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
AbiOP15mo ago
can I still use the same filament login page?
Dennis Koch
Dennis Koch15mo ago
Shouldn't be an issue
Abi
AbiOP15mo ago
ok, let me try

Did you find this page helpful?