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.

Steve Perry

Written by Steve Perry
Published on


Latest Articles

View All