/** * バルクインサート * * @param array $params * @param int $chunk_number */ public function bulkInsert(array $params, int $chunk_number = 1000) { $chunk_arrays = array_chunk($params, $chunk_number); foreach ($chunk_arrays as $chunk_array) { DB::table('sample_table')->insert($chunk_array); } }