get([],null,false,true))->chunk(50); $month = date('Y-m-d'); foreach ($chunks as $owners){ $date = date('Y-m-d H:i:s'); $createOwnerAreaReport = []; foreach ($owners as $owner){ $createOwnerAreaReport[] = [ "owner_id" => $owner->id, "counting_month" => $month, "user_owner_group_id" => $owner->user_owner_group_id, "created_at" => $date, ]; } DB::table("owner_area_reports")->insert($createOwnerAreaReport); } } }