rename models and associates, isolate botanic with shop

This commit is contained in:
Ludovic CANDELLIER
2020-04-21 00:09:32 +02:00
parent c80b0f1edf
commit 4ad1f18310
234 changed files with 13899 additions and 3230 deletions

View File

@@ -4,13 +4,13 @@ namespace App\DataTables;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\Product;
use App\Models\Shop\Article;
class ProductsDataTable extends DataTable
class ArticlesDataTable extends DataTable
{
public $model_name = 'Products';
public $model_name = 'Articles';
public function query(Product $model)
public function query(Article $model)
{
return self::buildQuery($model);
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\DataTables;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\Category;
class CategoriesDataTable extends DataTable
{
public $model_name = 'Categories';
public function query(Category $model)
{
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(120)
->addClass('text-center'),
];
}
}

View File

@@ -12,16 +12,18 @@ class SpeciesDataTable extends DataTable
public function query(Specie $model)
{
$model = $model::withCount('varieties')->with('genre');
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name'),
Column::make('name')->title('Nom'),
Column::make('alias'),
Column::make('genre_name'),
Column::make('latin'),
Column::make('genre'),
Column::make('varieties_count')->title('Nb variétés'),
Column::computed('action')
->exportable(false)
->printable(false)