Say I have a simple query to get all rows from a table:
App::make('My_Model')->get();
But I have a huge number of lines - say, 100,000, so many that PHP runs out of memory trying to read them all.
For some reason, I want to go through each of these lines and perform some operation based on them.
Is there any way to tell laravel to give me one row at a time how old mysql_fetch_row worked?
Note. I am currently solving this with limit () commands to get 5,000 rows at once, which works fine, except that it repeats the request 20 times.
I want to know if there is a built-in method in laravel or eloquent to give me the next line and not all the lines?
source
share