Laravel Chaperone Method
The chaperone() method avoids unexpected N+1 queries by linking back to the parent after the relationship query has run. The above relationship will link the appropriate Post model in the correct relation on Comment instances (with scopes intact). Links: Laravel Taylor s Full Keynote laravelnews on social: Instagram: Twitter: Facebook: LinkedIn: All our screencasting gear: Business Inquires: JOIN OUR WEEKLY LARAVEL NEWSLETTER
|
|