From b6d5ecea0f544855b49958599f734629dfad9e12 Mon Sep 17 00:00:00 2001 From: Mansoor Khan <8mansoorkhan@gmail.com> Date: Mon, 1 May 2023 23:18:09 +0500 Subject: [PATCH] Add support for SoftDeletes --- src/Tables/Http/Livewire/RevisionsPaginator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tables/Http/Livewire/RevisionsPaginator.php b/src/Tables/Http/Livewire/RevisionsPaginator.php index 9bbdf56..f5c92c3 100644 --- a/src/Tables/Http/Livewire/RevisionsPaginator.php +++ b/src/Tables/Http/Livewire/RevisionsPaginator.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; use Livewire\Component; +use Illuminate\Database\Eloquent\SoftDeletingScope; class RevisionsPaginator extends Component { @@ -31,7 +32,9 @@ class RevisionsPaginator extends Component */ public function updateRevisions(int $id): void { - $record = $this->record::withDrafts()->find($id); + $record = $this->record::withoutGlobalScopes([ + SoftDeletingScope::class, + ])->withDrafts()->find($id); $this->revisions = $record->revisions() // ->orderByDesc('is_current')