Skip to content

Commit

Permalink
Merge pull request #12 from makeabledk/fix/append-strategy
Browse files Browse the repository at this point in the history
Fix append strategy
  • Loading branch information
rasmuscnielsen authored Aug 23, 2023
2 parents f298d92 + 284717b commit 95572b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AppendStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function apply($rows, $query, $compareKey = null)
->each(function ($row) use ($query, $compareKey) {
$model = get_class($query->getModel());
$model::unguarded(function () use ($query, $compareKey, $row) {
$query->firstOrNew([$compareKey => $row[$compareKey]])->fill($row)->save();
(clone $query)->firstOrNew([$compareKey => $row[$compareKey]])->fill($row)->save();
});
});
}
Expand Down

0 comments on commit 95572b2

Please sign in to comment.