Skip to content

Commit

Permalink
Add support for SoftDeletes
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 authored May 1, 2023
1 parent 2fe6a34 commit b6d5ece
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Tables/Http/Livewire/RevisionsPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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')
Expand Down

0 comments on commit b6d5ece

Please sign in to comment.