I have a custom query that grabs data from the old system and maps it to models in the new system. The query looks like this:
$companies = DB::connection(\'leg
I believe you can use chunk on a query builder. E.g.
chunk
DB::connection('legacy')->select("...")->chunk(200, function($companies){ //do something with $companies });