Works for friday & saturday
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Shop\TagGroup;
|
||||
class TagGroupsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tag_groups';
|
||||
public $sortedColumn = 2;
|
||||
|
||||
public function query(TagGroup $model)
|
||||
{
|
||||
@@ -16,10 +17,29 @@ class TagGroupsDataTable extends DataTable
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('visible', function (TagGroup $tag_group) {
|
||||
return view("components.form.toggle", [
|
||||
'name' => 'visible',
|
||||
'value' => $tag_group->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $tag_group->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('code')->title('Code'),
|
||||
Column::make('visible')->title('Visible')->width(60)->searchable(false),
|
||||
Column::make('code')->title('Code')->width(100),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('tags_count')->title('#Tags')->searchable(false)->addClass('text-right')->width(60),
|
||||
$this->makeColumnButtons(),
|
||||
|
||||
Reference in New Issue
Block a user