I have a CRUD
Resource defined via Route::resource('User', 'UserController')
.
Since it is possible to generate CRUD
Gates 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 that would be an elegant way, since my polices would match my routes. I'm looking for a method like applyPolicy or something simliar:
Route::resource('User', 'UserController')->applyPolicy()
Otherwise I would have to add each policy to each action, which doesn't seem so elegant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With