select([ 'id', ]) ->where('id', '>', 0) ->chunkById(1000, function ($transactions) { Transaction::query() ->whereIn('id', $transactions->pluck('id')) ->update([ 'date' => Carbon::now(), 'value' => 1, ]); }); } }