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: hello@
----------------------------------------------------------------------
JOIN OUR WEEKLY LARAVEL NEWSLETTER
👉
----------------------------------------------------------------------
4 views
36
9
1 month ago 00:50:47 1
Laravel News Episode 221
2 months ago 00:09:11 1
Chaperone, Enum Support & Circular Model References in Laravel