From 8e40670ef3294afd4aa45cdd3a0436785f4dbaf9 Mon Sep 17 00:00:00 2001 From: Arayik Smbatyan Date: Fri, 1 Sep 2023 13:59:52 +0400 Subject: [PATCH] Bugfix impoert soft_delete record when scout.soft_delete is true --- src/Engines/TypesenseEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 74b3e83..76c30e9 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -168,7 +168,7 @@ public function update($models): void $models->each->pushSoftDeleteMetadata(); } - if (!$this->usesSoftDelete($models->first()) || is_null($models->first()?->deleted_at)) { + if (!$this->usesSoftDelete($models->first()) || is_null($models->first()?->deleted_at) || config('scout.soft_delete', false)) { $this->typesense->importDocuments($collection, $models->map(fn($m) => $m->toSearchableArray()) ->toArray()); }