show filter only if role is "Admin"

I am using Spatie permissioni package. How to resolve this please?
3 Replies
Dennis Koch
Dennis Kochβ€’2y ago
Use ->visible() as for form fields
LeandroFerreira
LeandroFerreiraβ€’2y ago
->visible(fn (): bool => auth()->user()->hasRole('Admin'))
->visible(fn (): bool => auth()->user()->hasRole('Admin'))
?
Falk Maria Zeitsprung
Falk Maria ZeitsprungOPβ€’2y ago
@leandro_ferreira that works perfect! πŸ™‚ thanks very much!!
Want results from more Discord servers?
Add your server