Disable single query loading in Eloquent ORM
While working on optimizing some queries, I found code that would load a large number of entities, grab their IDs and discard everything else. This causes errors / lengthy queries, while Eloquent eagerly loads all the relationships for those objects.
Since I know there is no need for linked objects in this case, I want to temporarily disable eager loading.
Is there a way to disable eager loading of the request?
+3
source to share