app/Http/Livewire/Datatable.php: change setTrashedColumns() into setTrashed().
This commit is contained in:
parent
0d05f3adbe
commit
b012f2b6bc
1 changed files with 11 additions and 4 deletions
|
|
@ -82,7 +82,7 @@ class Datatable extends Component
|
||||||
$this->delete_enabled = (bool) $delete_enabled;
|
$this->delete_enabled = (bool) $delete_enabled;
|
||||||
$this->restore_enabled = (bool) $restore_enabled;
|
$this->restore_enabled = (bool) $restore_enabled;
|
||||||
|
|
||||||
$this->setTrashedColumns();
|
$this->setTrashed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -165,14 +165,21 @@ class Datatable extends Component
|
||||||
return view('livewire.datatable', ['items' => $items]);
|
return view('livewire.datatable', ['items' => $items]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle trashed flag
|
||||||
|
*/
|
||||||
public function toggleTrashed()
|
public function toggleTrashed()
|
||||||
{
|
{
|
||||||
$this->trashed = !$this->trashed;
|
$this->setTrashed(!$this->trashed);
|
||||||
$this->setTrashedColumns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setTrashedColumns()
|
/**
|
||||||
|
* Set trashed flag.
|
||||||
|
*/
|
||||||
|
public function setTrashed($value)
|
||||||
{
|
{
|
||||||
|
$this->trashed = (bool) $value;
|
||||||
|
|
||||||
if ($this->trashed) {
|
if ($this->trashed) {
|
||||||
// Add deleted_at columns.
|
// Add deleted_at columns.
|
||||||
$this->columns['deleted_at'] = 'Deleted at';
|
$this->columns['deleted_at'] = 'Deleted at';
|
||||||
|
|
|
||||||
Reference in a new issue