29 lines
555 B
PHP
29 lines
555 B
PHP
<?php
|
|
|
|
namespace App\DataTables\Shop;
|
|
|
|
use Yajra\DataTables\Html\Column;
|
|
use App\DataTables\ParentDataTable as DataTable;
|
|
use App\Models\Shop\Unity;
|
|
|
|
class UnitiesDataTable extends DataTable
|
|
{
|
|
public $model_name = 'Unity';
|
|
|
|
public function query(Unity $model)
|
|
{
|
|
$model = $model::with(['price_family']);
|
|
return self::buildQuery($model);
|
|
}
|
|
|
|
protected function getColumns()
|
|
{
|
|
return [
|
|
Column::make('value')->title('Attributs'),
|
|
Column::make('price_family.name')->title('Famille')->orderable(false),
|
|
self::makeColumnButtons(),
|
|
];
|
|
}
|
|
|
|
}
|