getAirline($row['airline']); $row['airline_id'] = $airline->id; $subfleet = Subfleet::firstOrNew([ 'type' => $row['type'] ], $row); try { $subfleet->save(); } catch(\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; } $this->log('Imported '.$row['type']); return true; } }