Back to Browse

Laravel N+1 Query: preventLazyLoading() Doesn't Work?

4.6K views
Jun 6, 2024
6:07

Laravel has a mechanism to catch the lazy loading, but let me show you one caveat on how it works, and how to PROPERLY enable it. Links mentioned in the video: - [Docs] Preventing Lazy Loading: https://laravel.com/docs/11.x/eloquent-relationships#preventing-lazy-loading - My other videos on the N+1 Query problem: https://www.youtube.com/@LaravelDaily/search?query=n%2B1 - My course "Testing in Laravel For Beginners": https://laraveldaily.com/course/testing-laravel - - - - - Support the channel by checking out my products: - My Laravel courses: https://laraveldaily.com/courses - Filament examples: https://filamentexamples.com - Livewire Kit Components: https://livewirekit.com - - - - - Other places to follow: - My weekly Laravel newsletter: https://us11.campaign-archive.com/home/?u=a459401212599a54203d036ee&id=91c1337873 - My personal Twitter: https://twitter.com/povilaskorop

Download

1 formats

Video Formats

360pmp49.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Laravel N+1 Query: preventLazyLoading() Doesn't Work? | NatokHD