Eoghan O'Brien
fullstack developer

Dynamic Laravel Eloquent model relationships

Laravel Eloquent models are not `Macroable` by default, if you want to add a relationship dynamically on a model in another module or package, you need to macro through the `Builder` instead of the `Model`.

read more

Define a custom collection for your Eloquent model

Many Laravel newbies don't know that you can customize the collection returned by a query, so they end up writing tons of after-query functions to wrangle their results. I know a better way.

read more