Eager loading Eloquent properties →
A simple, performant solution for eager-loading Eloquent relationships, when you're only interested in one or two specific properties on the related model.
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 creating
, updating
, and deleted
.
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.