29 lines
699 B
PHP
29 lines
699 B
PHP
<?php
|
|
|
|
namespace App\Datatables\Shop;
|
|
|
|
use Yajra\DataTables\Html\Column;
|
|
use App\Datatables\ParentDataTable as DataTable;
|
|
use App\Models\Shop\Offer;
|
|
|
|
class OffersDataTable extends DataTable
|
|
{
|
|
public $model_name = 'offers';
|
|
|
|
public function query(Offer $model)
|
|
{
|
|
$model = $model->with(['article','variation','tariff'])->select(['shop_offers.*']);
|
|
return self::buildQuery($model);
|
|
}
|
|
|
|
protected function getColumns()
|
|
{
|
|
return [
|
|
Column::make('article.name')->title('Article'),
|
|
Column::make('variation.name')->title('Déclinaison'),
|
|
Column::make('tariff.name')->title('Tarif'),
|
|
self::makeColumnButtons(),
|
|
];
|
|
}
|
|
}
|