29 lines
565 B
PHP
29 lines
565 B
PHP
<?php
|
|
|
|
namespace App\DataTables\Botanic;
|
|
|
|
use Yajra\DataTables\Html\Column;
|
|
use App\DataTables\ParentDataTable as DataTable;
|
|
use App\Models\Botanic\Variety;
|
|
|
|
class VarietiesDataTable extends DataTable
|
|
{
|
|
public $model_name = 'Varieties';
|
|
|
|
public function query(Variety $model)
|
|
{
|
|
$model = $model::with('specie')->select(['botanic_varieties.*']);
|
|
return self::buildQuery($model);
|
|
}
|
|
|
|
protected function getColumns()
|
|
{
|
|
return [
|
|
Column::make('specie.name')->title('Espèce'),
|
|
Column::make('name')->title('Nom'),
|
|
self::makeColumnButtons(),
|
|
];
|
|
}
|
|
|
|
}
|