Increase performance by using Eloquent's `setRelation` method
While working on the upcoming Oh Dear redesign, I noticed that list that displays all sites of a team was very slow.
To display that list, a lot of queries were used. With a couple of minor adjustments, I could reduce the number of queries needed to just a single one, solving the performance problem.
In this small blog post, I'd like to share one of the techniques I used.