I have a resource CRUDdefined through Route::resource('User', 'UserController').
Since it is possible to generate CRUDGates and Policies, is there a way to apply such a Gate / Policy so that the corresponding gate / policy is applied to a specific route?
I think this would be an elegant way, since my policies would fit my routes. I am looking for a method like applyPolicy or something simliar:
Route::resource('User', 'UserController')->applyPolicy()
Otherwise, I would have to add every policy to every action that doesn't seem so elegant.
Elwin source
share