public function executeBulkDataToDev($query) { $insertion_string = ''; $data_chunk = array_chunk($this->employee_attendance_data, 10000); foreach ($data_chunk as $chunk_item) { $key_value_array_count = count($chunk_item); foreach ($chunk_item as $index_number => $data_array) { if ($index_number == $key_value_array_count - 1) { $insertion_string .= "( " . "'" . implode("','", $data_array) . "'" . " )"; } else { $insertion_string .= "( " . "'" . implode("','", $data_array) . "'" . " ),"; } } $query = $query . $insertion_string; $rand = rand(10000, 99999); $today = Carbon::now(); $file_name = $today->year . $today->month . $today->day . $today->hour . $today->minute . $today->second . $today->micro; $file_name = $file_name . $rand . '.txt'; //\Storage::disk('local')->put($file_name, $query); $pdo_conn = \DB::connection('mysql')->getPdo(); try { $pdo_conn->exec($query); \Storage::disk('local')->delete($file_name); //$update = " UPDATE TRG_ID_BASE SET PROCESSED_STATUS = 1 WHERE TRG_ID <= $data_array[punch_trg_id] "; //$this->fb_repository->executeUpdateQuery($update); } catch (\Exception $e) { $message = __METHOD__ . ' Line: ' . __LINE__ . ' >> ' . $e->getMessage(); print_r($message); exit(0); } } return true; }