Files
opensem/app/DataTables/Shop/ArticleAttributeFamiliesDataTable.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\ArticleAttributeFamily;
class ArticleAttributeFamiliesDataTable extends DataTable
{
public $model_name = 'ArticleAttributeFamilies';
public function query(ArticleAttributeFamily $model)
{
$model = $model::withCount(['values']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name'),
Column::make('values_count')->title('Nb valeurs')->searchable(false),
Column::computed('action')
->exportable(false)
->printable(false)
->width(120)
->addClass('text-center'),
];
}
}