Back Button Frameworks
Advanced Eloquent

Advanced Eloquent

Sure, you've learned the essentials of using Eloquent in your applications, but do you really understand what's going on under the hood? Well, that's specifically what we're interested in for this series. How do all the bits and pieces fit together?

Advanced
5 episodes
58m
5
Latest Episode in This Series

Added 5 years ago

Eager Loading is a Beast

The reality is that there's significant complexity to a full-featured ORM, like Eloquent. One area where this...

Watch
Advanced Eloquent

Advanced Eloquent

Sure, you've learned the essentials of using Eloquent in your applications, but do you really understand what's going on under the hood? Well, that's specifically what we're interested in for this series. How do all the bits and pieces fit together?

Begin
5
Latest Episode in This Series

Added 5 years ago

Eager Loading is a Beast

The reality is that there's significant complexity to a full-featured ORM, like Eloquent. One area where this...
Watch

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.
    1. Free Episode Run Time 8:11

      Before we dive into Eloquent, let's build the world so that we may toy around. As part of the process, we'll create some migrations, models, and seed classes.

    2. Our starting point is a laughable one: Post::find(1). It's literally the first thing you learn how to do with Eloquent. But, think about it, do you fully understand what happens behind the scenes, when you make this call?

    3. Okay, so we can do things like Post::where($args), but there's just one problem: where exactly is that where method stored? It's definitely not on our Model class!

    4. Run Time 8:25

      Okay, let's move to a lower level, and figure out how the query builder actually constructs these SQL queries and passes them to PDO.

    5. The reality is that there's significant complexity to a full-featured ORM, like Eloquent. One area where this is immediately apparent is eager loading. In this episode, as best as we can, we'll decode this process, piece by piece. How exactly does Post::with('comments')->get() work underneath the hood?