I updated to 11.22 because it happened to be the feature I was needing at the moment. It's not that we don't know how to do it manually. The point is that it's easy to forget to do it and end up with the n+1 query problem. It's just handy. And about the naming: I think that "goAlong" would be nice too: $this->hasMany(Video::class)->goAlong()->orderBy('position');
so let me get it strait, from what i see chaperone remove one extra loop meaning it's setting the relation object on episodes collection instantiation instead of creating the collection and then looping it and setting the rel.
Jeffrey really has a knack for educating complete beginners like me😅. Bravo🎉
Love your videos, here and at laracast.
That outro was awesome, loved it
I updated to 11.22 because it happened to be the feature I was needing at the moment. It's not that we don't know how to do it manually. The point is that it's easy to forget to do it and end up with the n+1 query problem. It's just handy. And about the naming: I think that "goAlong" would be nice too: $this->hasMany(Video::class)->goAlong()->orderBy('position');
Are you planning to discuss all the new features that were announced at the recent Laracon? That's much needed now.
Yes, on Laracasts.
@@Laracastsofficial Thanks! 👏
Best Teacher ever!
Hmm I would probably just pass the $series model to the map callback function with use($series)
First thing I thought about too.
It’s a silly example. The point is you will often not have immediate access to the parent series model.
very helpful thank you 🙌
oh, so interesting method)
Thanks ❤
Can't we just return $series->title immediately inside the map function?
you can, the examples sometimes that they show are not completely clear on the use cases
That's what I was thinking. I guess chaperone might be useful if you're a senior dev trying to prevent a junior from making the mistake though.
I think we were trying to avoid n+1
jeffrey, yes we need to know the internals please
That's amazing
so let me get it strait, from what i see chaperone remove one extra loop meaning it's setting the relation object on episodes collection instantiation instead of creating the collection and then looping it and setting the rel.
What's the theme phostrome jeff?
Is defer also available?
Thank You ❤
Wouldn’t the $with property on the model do this ?
Quick question, is chaperone() available only for hasMany relationships or can we use it for belongsToMany(), if we can't, anyone knows why?
Besides applying it to the episodes, do we need to apply it to the inverse relation (series)?
Why wouldn't you want to have this on all the time? What is the disadvantage?
What's the music in intro wanna make that my ringtone so catchy.
Are you using vim motions?
Can I use it on Larave 10.x ?