🔥 Laravel Tip: Eager loading with limits
Nov 11, 2022
If you try to add a limit when you are eager loading a relationship (ex. get the last 3 posts for each user) you might notice that you don't get the results you expected.
You can solve this using @staudenmeir extension:
https://github.com/staudenmeir/eloquent-eager-limit
You can solve this using @staudenmeir extension:
https://github.com/staudenmeir/eloquent-eager-limit
Other tips:
🔥 Laravel tip: the `isDirty` method
Jan 28, 2022
🔥 Laravel Tip: Disable HTML scraping in blade
Apr 8, 2021