diff --git a/src/Services/ImportService.php b/src/Services/ImportService.php index 0e93a06..1449451 100644 --- a/src/Services/ImportService.php +++ b/src/Services/ImportService.php @@ -80,11 +80,11 @@ public function run(): bool|string } if ($this->updateWhenExists) { - $item = filled($this->updateKeys) ? $this->updateKeys : (new $this->model)->getKeyName(); + $updateKeys = filled($this->updateKeys) ? $this->updateKeys : (new $this->model)->getKeyName(); $this->model::updateOrCreate( - Arr::only($item, $item), - Arr::except($item, $item), + Arr::only($item, $updateKeys), + Arr::except($item, $updateKeys), ); } else { $this->model::create($item);