Skip to content

Commit

Permalink
feat: add support for soft deletes
Browse files Browse the repository at this point in the history
Add support for SoftDeletes
  • Loading branch information
lukas-frey authored May 4, 2023
2 parents 2fe6a34 + b6d5ece commit 7b57b48
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 7b57b48

Please sign in to comment.