Gate a Vue index with viewAny
viewAny takes the model class, not a row. Call it on the index before you paginate.
viewAny takes the model class, not a row. Call it on the index before you paginate.
role and permission middleware refuse the request. The Vue page only receives a boolean it can show.
Share the gate as a boolean. The controller still calls authorize on the POST.
authorize() in the controller is the check. The Vue button can hide itself later.
A policy decides whether this user can update this post. The Vue page receives that boolean. The controller still calls authorize.
Spatie stores the permission. The controller still checks it. The Vue page only receives a boolean, so a hidden button is not the authorization.
Newsletter
One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.