Skip to content

Commit

Permalink
Merge pull request #66 from bkremenovic/fix/soft-delete
Browse files Browse the repository at this point in the history
Align SoftDelete logic with Model::preventAccessingMissingAttributes()
  • Loading branch information
arayiksmbatyan committed May 18, 2023
2 parents 9ccd724 + 3afb17d commit 026187e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Engines/TypesenseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function update($models): void
$models->each->pushSoftDeleteMetadata();
}

if (is_null($models->first()?->deleted_at)) {
if (!$this->usesSoftDelete($models->first()) || is_null($models->first()?->deleted_at)) {
$this->typesense->importDocuments($collection, $models->map(fn($m) => $m->toSearchableArray())
->toArray());
}
Expand Down

0 comments on commit 026187e

Please sign in to comment.