filepath = $filepath; } /** * Execute the job. */ public function handle(): void { $mapping = [ 'name' => 0, 'translation' => 1, ]; $fileStream = fopen($this->filepath, 'r'); $skipHeader = true; while ($row = fgetcsv($fileStream)) { if ($skipHeader) { $skipHeader = false; continue; } Word::updateOrCreate( [ 'name' => $row[$mapping['name']], 'translation' => $row[$mapping['translation']], ] ); } fclose($fileStream); Storage::delete($this->filepath); } }