show filter only if role is "Admin"

I am using Spatie permissioni package. How to resolve this please?
3 Replies
Dennis Koch
Dennis Koch2y ago
Use ->visible() as for form fields
LeandroFerreira
->visible(fn (): bool => auth()->user()->hasRole('Admin'))
->visible(fn (): bool => auth()->user()->hasRole('Admin'))
?
Falk Maria Zeitsprung
@leandro_ferreira that works perfect! 🙂 thanks very much!!

Did you find this page helpful?