Added update or create record on import
This commit is contained in:
@@ -31,12 +31,19 @@ class LineStopImporter extends Importer
|
||||
|
||||
public function resolveRecord(): ?LineStop
|
||||
{
|
||||
return LineStop::updateOrCreate([
|
||||
'code' => $this->data['code']
|
||||
],
|
||||
[
|
||||
'reason' => $this->data['reason']
|
||||
]
|
||||
);
|
||||
// return LineStop::firstOrNew([
|
||||
// // Update existing records, matching them by `$this->data['column_name']`
|
||||
// 'email' => $this->data['email'],
|
||||
// ]);
|
||||
|
||||
return new LineStop();
|
||||
// return new LineStop();
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Import $import): string
|
||||
|
||||
Reference in New Issue
Block a user