Add new version in repository
This commit is contained in:
28
app/Datatables/Shop/OffersDataTable.php
Normal file
28
app/Datatables/Shop/OffersDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 = 'tariffs';
|
||||
|
||||
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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user