app/Http/Livewire/Datatable.php: Adding $route_restore variable
This commit is contained in:
parent
a88e21fb19
commit
11026c0c6e
1 changed files with 9 additions and 2 deletions
|
|
@ -53,13 +53,19 @@ class Datatable extends Component
|
||||||
*/
|
*/
|
||||||
public $route_delete;
|
public $route_delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Route for restoring a record (if null, link is omitted)
|
||||||
|
*/
|
||||||
|
public $route_restore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How many records should be displayed on one page.
|
* How many records should be displayed on one page.
|
||||||
*/
|
*/
|
||||||
public int $itemsPerPage = 30;
|
public int $itemsPerPage = 30;
|
||||||
|
|
||||||
public function mount(string $model, array $columns, array $sort_columns = [],
|
public function mount(string $model, array $columns,
|
||||||
$default_sort = '', $route_create = null, $route_delete = null, $route_edit = null)
|
array $sort_columns = [], $default_sort = '',
|
||||||
|
$route_create = null, $route_edit = null, $route_delete = null, $route_restore = null)
|
||||||
{
|
{
|
||||||
$this->model = app()->make($model);
|
$this->model = app()->make($model);
|
||||||
$this->default_sort = $default_sort;
|
$this->default_sort = $default_sort;
|
||||||
|
|
@ -68,6 +74,7 @@ class Datatable extends Component
|
||||||
$this->route_create = $route_create;
|
$this->route_create = $route_create;
|
||||||
$this->route_edit = $route_edit;
|
$this->route_edit = $route_edit;
|
||||||
$this->route_delete = $route_delete;
|
$this->route_delete = $route_delete;
|
||||||
|
$this->route_restore = $route_restore;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Reference in a new issue