Skip to content

Commit

Permalink
fixing a bug on importing with exsiting keys by modifying the variabl…
Browse files Browse the repository at this point in the history
…e name
  • Loading branch information
vildanbina committed Mar 20, 2023
1 parent c938b5e commit 408c468
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Services/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 408c468

Please sign in to comment.