F
Filamentβ€’2y ago
alcmz

Disabled field based on Roles define

I have the following code and wanted to disabled the STATUS field but only for certain roles such as Sales Manager & Sales Team . Meanwhile, as for another roles it can edit/modify it such as Operation . Can anyone point me out where should i refer to ? Do i need to add anything inside the disabled("somethinghere")
2 Replies
Vp
Vpβ€’2y ago
->disabled(fn () => ! auth()->user()->can('update')) maybe πŸ˜€
alcmz
alcmzOPβ€’2y ago
Thanks Bud! . got it worked with HasAnyRole disabled(fn () => ! auth()->user()->hasAnyRole(['super_admin'])),
Want results from more Discord servers?
Add your server