Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.

About This Episode

Published on Apr 21st, 2021

We introduced a subtle performance issue in the last episode that's known as the N+1 problem. Because Laravel lazy-loads relationships, this means you can potentially fall into a trap where an additional SQL query is executed for every item within a loop. Fifty items...fifty SQL queries. In this episode, I'll show you how to debug these queries - both manually, and with the excellent Clockwork extension - and then we'll solve the problem by eager loading any relationships we'll be referencing.

Discuss It

Episodes

  1. Section 1 Prerequisites and Setup

    1. Why Do We Use Tools

      Free Episode 2:37
  2. Section 2 The Basics

    1. How a Route Loads a View

      Free Episode 4:32
  3. Section 3 Blade

    1. Blade Layouts Two Ways

      Free Episode 8:05
  4. Section 4 Working With Databases

    1. Route Model Binding

      Free Episode 5:29
    2. Turbo Boost With Factories

      Free Episode 10:45
  5. Section 5 Integrate the Design

  6. Section 6 Search

    1. Search (The Messy Way)

      Free Episode 5:04
  7. Section 7 Filtering

  8. Section 8 Pagination

  9. Section 9 Forms and Authentication

    1. Login and Logout

      Free Episode 10:53 View Source
Enlightn your Laravel app
Back to Series Button