Laravel
QA
Home
Articles
About
Home
Articles
About
All Articles
Every article published so far — filter by topic, or sort by what readers actually read.
All topics
Sort
Newest
Most read
Why is my Laravel page running hundreds of queries? (The N+1 problem, explained)
You're loading a list of models, then touching a relationship on each one inside a loop. Laravel runs 1 query for the list + 1 query per row for the relationship. That's the N+1 problem. The fix is to tell Eloquent up front which relationships you need, with with(), so it loads them in one extra query instead of N.
Nov 20, 2026
·
4 min read