Archived
1
0
Fork 0

app/Http/Livewire/Datatable.php: Adding $default_sort variable

This commit is contained in:
Henrik Hautakoski 2022-01-23 12:43:15 +01:00
parent 9bc409f203
commit a88e21fb19

View file

@ -36,6 +36,11 @@ class Datatable extends Component
*/
public array $sort_columns;
/**
* Default sorting column
*/
public string $default_sort;
public $route_create;
/**
@ -57,7 +62,8 @@ class Datatable extends Component
$default_sort = '', $route_create = null, $route_delete = null, $route_edit = null)
{
$this->model = app()->make($model);
$this->sort = $default_sort;
$this->default_sort = $default_sort;
$this->sort = $this->default_sort;
$this->sort_columns = $sort_columns;
$this->route_create = $route_create;
$this->route_edit = $route_edit;