Replies: 2 comments 5 replies
-
Have you tried Query Builder instead? https://laravel.com/docs/queries |
Beta Was this translation helpful? Give feedback.
1 reply
-
Use LazyCollections with ExchangeModel::byProductId($productId)
->afterDate(date('Y-m-d H:i:s', strtotime('-1 week')))
->orderById()
->toBase()
->cursor(); |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I am working with a project that need a high performance backend working with millions of rows and I have a small problem with Eloquent.
This query is returning about 5 millions of rows:
This query returns a Collection of Models, but I need a Collection of plain objects.
I can't do
->get()->toArray()
because->get()
method implies to have millions of models in memory to convert to array after that.There are some method to get a Collection (or array) of plain objects from a Model without an intermediate step?
Maybe this is the
right way
to do it?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions