getRows() ->chunk(200) ->each(function (LazyCollection $chunk) { foreach ($chunk as $row) { $row = array_values($row); /* 0 => 1 1 => 87 2 => 3614 3 => 1491 4 => DateTimeImmutable @1777334400 {#2722 ▶} 5 => 0.90433699503783 6 => 1.035168989838 */ StatisticFixtures::updateOrCreate( [ 'sport_id' => (int) $row[0], 'league_id' => (int) $row[1], 'home_id' => (int) $row[2], 'away_id' => (int) $row[3], 'starttime' => Carbon::parse($row[4])->toDateTimeString(), ], ['exp_home' => (float) $row[5], 'exp_away' => (float) $row[6]] ); } }); } }