Nova uses Laravel policies to manage resource authorisation. This can be problematic when it comes to resource actions.
Step-by-step instructions on using a private GitLab repository as a Composer package source.
How to conditionally apply Laravel validation rules, even when you don’t have access to a validator instance.
Don't like the URL slug that Laravel Nova has chosen for a resource? Here's how to choose your own.
Laravel makes heavy use of the
Macroable trait throughout its codebase, but the official docs only mention it in passing. Let's dig in.
Route model binding is a very useful Laravel feature. But what happens if you have an endpoint which needs to support multiple, comma-delimited IDs? Route collection binding to the rescue.
The standard method for removing a global scope from an Eloquent model is a little clunky. We can do better.
I recently found myself with the need to add a custom method to the
LengthAwarePaginator class. Not a problem, I thought, I'll write a quick macro. A fine solution, but for the fact the
LengthAwarePaginator isn't "macroable". Or so it would seem at first glance.
A simple, performant solution for eager-loading Eloquent relationships, when you're only interested in one or two specific properties on the related model.
Eloquent makes it easy to respond to certain key points in the lifecycle of a model instance, by exposing events such as
There's an important gotcha to remember when working with Eloquent and default database values: if you create a new model instance, without overriding a default value, the attribute will not be set.