Written by Steve Perry
Published on
Laravel Tip
If you want a model to always eager load a relationship, you can add protected $with = [‘relation’];
to your Eloquent class.
Tip courtesy of @laracasts.
Written by Steve Perry
Published on
If you want a model to always eager load a relationship, you can add protected $with = [‘relation’];
to your Eloquent class.
Tip courtesy of @laracasts.