Files
opensem/app/DataTables/Shop/ArticleAttributeValuesDataTable.php
Ludovic CANDELLIER d0e3bb6251 Attributes
2020-05-05 19:07:11 +02:00

33 lines
705 B
PHP

<?php
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\ArticleAttributeValue;
class ArticleAttributeValuesDataTable extends DataTable
{
public $model_name = 'ArticleAttributeValues';
public function query(ArticleAttributeValue $model)
{
$model = $model::with(['attribute_family']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('attribute_family.name')->title('Famille d\'attributs'),
Column::make('value'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(120)
->addClass('text-center'),
];
}
}