Following up on this Question: How to chunk results from a custom query in Laravel
I try
DB::connection('mgnt')->select($query)->chunk(200, function($orders) {
foreach ($orders as $order) {
//a bunch of code...
}
});
But I get the following error:
FatalErrorException in MigrationController.php line 98:
Call to a member function chunk() on array
Is chunking possible without having an appropriate Eloquent ORM Model? I try to chunk because I get a blank page (can't find any errrors in any log) if the query returns too many results.
I think right now it max 50.000 results that I can query at once. Is that maybe due to some restriction or limitation in Laravel?