Category: Laravel, Laravel, PHP, PHP

Of course they work with Eloquent, but turns they work with any class.

Before we get into this idea, I just want to cover when I would reach for a Gate or a Policy.

For whatever reason we have setup an endpoint you can hit and it triggers your application to deploy.

This is why we can't use a Policy for our Keyboard controller; we don't have an internal representation of a keyboard!

We can now use Route Model Binding to get our Keyboard object and pass it directly to our authorization call.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners