I believe that you should not look at the HandlesAuthorization . All you have to do is implement the failedAuthorization method in your query class.
In the FormRequest class FormRequest it is defined as follows:
protected function failedAuthorization() { throw new AuthorizationException('This action is unauthorized.'); }
so all you need is to override this method in your UpdateRoleRequest class, for example, as follows:
protected function failedAuthorization() { throw new \Illuminate\Auth\Access\AuthorizationException('User has to be an admin.'); }
Marcin nabiaลek
source share