Laravel Eloquent performance issue

Solution:

Finally I found out where the problem is. Actually, that issue is not really caused by Eloquent ORM but the view. That are what I did for fixed the problem

  • Eager loading: Since there are 4 relations in my view, so it cause N + 4 queries , I use the eager loading to fixed it. and use
  • Cache: I use remember() to cache results.
  • Cancel the Image checking: last things I did but most important, is to cancel the checking the Images in S3.

The page loading get a huge speed up. 🙂