Skip to main content

"Black Friday" Discount! Only until December 1st: 50% off all membership plans!

Read more here
Quick Tip

Disable lazy loading when running your tests

If you don't want to prevent lazy loading when running your tests you can disable it

Model::preventLazyLoading(!$this->app->isProduction() && !$this->app->runningUnitTests());

Tip given by @djgeisi

Enjoyed This Tip?

Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.

Recent Courses on Laravel Daily