Files
opensem/app/DataTables/Shop/ArticleAttributeFamiliesDataTable.php
2020-06-07 23:15:22 +02:00

29 lines
650 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(['Attributes']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name')->title('Nom'),
Column::make('attributes_count')->title('Nb attributs')->searchable(false)->addClass('text-right'),
self::makeColumnButtons(),
];
}
}