From b4c46d447bb07d82f1e5f014e77515574e44b862 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 23 Jan 2022 12:51:25 +0100 Subject: [PATCH] app/Http/Livewire/Datatable.php: in render() apply onlyTrashed() to query if $this->trashed is set. --- app/Http/Livewire/Datatable.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Livewire/Datatable.php b/app/Http/Livewire/Datatable.php index c804486..1fd97a4 100644 --- a/app/Http/Livewire/Datatable.php +++ b/app/Http/Livewire/Datatable.php @@ -92,6 +92,11 @@ class Datatable extends Component { $query = $this->model->query(); + // Only include trashed if asked to. + if ($this->trashed) { + $query->onlyTrashed(); + } + // Check colums for "dot-notated" strings. // as we want to eager load those relationships foreach ($this->columns as $col => $_) {