add offers count, & minor fixes code standards
This commit is contained in:
@@ -12,15 +12,21 @@ class DeliveriesDataTable extends DataTable
|
||||
|
||||
public function query(Delivery $model)
|
||||
{
|
||||
$model = $model->with('SaleChannel');
|
||||
return self::buildQuery($model);
|
||||
$model = $model->with('sale_channel');
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('active', function (Delivery $delivery) {
|
||||
return view("components.form.toggle", ['value' => $delivery->active, 'on' => __('active'), 'off' => __('inactive'), 'meta' => 'data-id='.$delivery->id, 'size' => 'sm']);
|
||||
return view("components.form.toggle", [
|
||||
'value' => $delivery->active,
|
||||
'on' => __('active'),
|
||||
'off' => __('inactive'),
|
||||
'meta' => 'data-id='.$delivery->id,
|
||||
'size' => 'sm',
|
||||
]);
|
||||
})
|
||||
->rawColumns(['active', 'action']);
|
||||
return parent::modifier($datatables);
|
||||
@@ -35,7 +41,7 @@ class DeliveriesDataTable extends DataTable
|
||||
Column::make('address')->title('Adresse'),
|
||||
Column::make('zipcode')->title('Code postal'),
|
||||
Column::make('city')->title('Ville'),
|
||||
self::makeColumnButtons(),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user