Closed ghost closed 4 years ago
Also, if you’ve got a moment, please vote for this article in the Laravel Blog competition: leave a “👍” emoji reaction on the issue corresponding to the this post.
I recommend you to remove that line. The contest states that:
To be fair to those with smaller audiences, you may not lobby for votes via Twitter, etc.
@DarkGhostHunter I have no idea what you’re talking about. What line?
How does that solve the problem with Fractal? This just says to use another solution which some of us may not be able to refactor right away.
@pavankataria well, you have to replace fractal with native Eloquent Resources, which are similar to transformers, with the difference of requesting the DB relation only when is requested (whenLoaded()).
The article's main focus is the n+1 problem, not the fractal package.
https://medium.com/@giuvara.alex/how-to-solve-the-n-1-problem-introduced-by-fractal-7ba7936b8b81