5 Replies
Hey there,
You can use the
->disabled()
method on the field in pair with callback function.
Almost all methods available on the Fields can accept a callback.
So what you can do is
->disabled(function(){
return auth()->user()->hasRole(...);
})
Read this, it can help ALOT
I need to use the ->disableOn method on field in edit depending on user Role. i did : ->disabledOn(['edit',!auth()->user()->hasAnyRole(['super_admin', 'admin'])
]),