Well, I don't think you are sending 500 records in one api request, are you? You should paginate your eloquent queries like this.
Nov 23, 2020
4
Level 5
Laravel Accessors on Query Builder
I am currently working on a Laravel API project and I am retrieving a lot of records. I used eloquent, however it is slow when retrieving at least 500 records. I have seen on other posts that it would be better to use query builder but I have Laravel accessors to retrieve some data which can only be called upon retrieving records with eloquent. Is it possible to use it on a query builder and how can I implement it?
Level 122
check you dont have n+1 issues if you are fetching related data in accessors
1 like
Please or to participate in this conversation.