29 lines
650 B
PHP
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(),
|
|
];
|
|
}
|
|
|
|
}
|