Compatible with spatie/laravel-permission #798
-
Is it possible to check if a user has an certain permission so the button can be disabled? |
Beta Was this translation helpful? Give feedback.
Answered by
dansysanalyst
Feb 12, 2023
Replies: 1 comment
-
You can use the Action Rules It would be something like: Rule::button('delete')
->when(fn() => auth()->user()->can('delete_stuff') === false)
->disable(), |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
luanfreitasdev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the Action Rules
It would be something like: