🔥 Laravel Tip: Eager load and filter by a nested relationship
Sep 15, 2022
If you need to filter a model by a nested relationship and also eager load both of the relationships you can create a closure that takes care of the logic and pass it to both `with` and `whereHas`
Edit: Apparently, there is a `withWhereHas` method in core that I miss, in Laravel v9.16.0 and above you can use that instead.
Edit: Apparently, there is a `withWhereHas` method in core that I miss, in Laravel v9.16.0 and above you can use that instead.

Other tips:
🔥 Laravel Tip: The retry helper
Apr 19, 2022
🔥 Laravel Tip: the wasChanged method
Apr 8, 2022
🔥 Cache cheat sheet
Mar 21, 2022