bezhanSalleh / filament-panel-switch

The Panel Switch Plugin for Filament offers a robust and customizable component for switching between panels in applications built with FilamentPHP.
MIT License
123 stars 21 forks source link

[Question]: How can I only display panels that I have access to #22

Closed mstfkhazaal closed 8 months ago

mstfkhazaal commented 8 months ago

What happened?

How can I only display panels that I have access to

How to reproduce the bug

i try this but not work ->visible(fn (): bool => auth()->user()?->hasAnyRole([ 'admin', 'general_manager', 'super_admin', ]));

Package Version

1.0.5

PHP Version

8.2

Laravel Version

10.0

Which operating systems does with happen with?

macOS

Notes

No response

micraux commented 8 months ago

Hello,

Where are you trying to put your code?

Is it in the panel-switch-menu.blade.php file?

bezhanSalleh commented 8 months ago

use the exclude() method it also accepts a closure