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
Vp2y ago
->disabled(fn () => ! auth()->user()->can('update')) maybe 😀
alcmz
alcmzOP2y ago
Thanks Bud! . got it worked with HasAnyRole disabled(fn () => ! auth()->user()->hasAnyRole(['super_admin'])),

Did you find this page helpful?