You can disable lazy loading using Model::preventLazyLoading()

You can disable lazy loading using Model::preventLazyLoading()

🔥 #Laravel Tip: Protect your database from the dangers of lazy loading by disabling it in your Laravel app. You can also customise how violations are handled, which is perfect for models outside of your control e.g. within packages.

We're writing a book, you can get it for free here.