[WIP] Refactor architecture, models

This commit is contained in:
Ludovic CANDELLIER
2020-04-22 01:26:03 +02:00
parent e370174f94
commit a18d30b65c
39 changed files with 446 additions and 266 deletions

View File

@@ -23,7 +23,7 @@ class GenresDataTable extends DataTable
Column::make('alias'),
Column::make('latin'),
Column::make('family.name'),
Column::make('species_count')->title('Nb Espèces'),
Column::make('species_count')->title('Nb Espèces')->searchable(false),
Column::computed('action')
->exportable(false)
->printable(false)

View File

@@ -21,9 +21,9 @@ class SpeciesDataTable extends DataTable
return [
Column::make('name')->title('Nom'),
Column::make('alias'),
Column::make('genre_name'),
Column::make('genre.name'),
Column::make('latin'),
Column::make('varieties_count')->title('Nb variétés'),
Column::make('varieties_count')->title('Nb variétés')->searchable(false),
Column::computed('action')
->exportable(false)
->printable(false)

View File

@@ -19,8 +19,8 @@ class VarietiesDataTable extends DataTable
protected function getColumns()
{
return [
Column::make('specie_name'),
Column::make('name'),
Column::make('specie_name')->title('Espèce'),
Column::make('name')->title('Nom'),
Column::computed('action')
->exportable(false)
->printable(false)

View File

@@ -1,6 +1,6 @@
<?php
namespace App\DataTables;
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\DataTables;
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;

View File

@@ -1,14 +1,14 @@
<?php
namespace App\DataTables;
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\Product;
use App\Models\Shop\Customer;
class ProductsDataTable extends DataTable
class CustomersDataTable extends DataTable
{
public $model_name = 'Products';
public $model_name = 'Customers';
public function query(Product $model)
{
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
{
return [
Column::make('name'),
Column::make('alias'),
Column::make('latin'),
Column::computed('action')
->exportable(false)
->printable(false)

View File

@@ -1,14 +1,14 @@
<?php
namespace App\DataTables;
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\Product;
use App\Models\Shop\Invoice;
class ProductsDataTable extends DataTable
class InvoicesDataTable extends DataTable
{
public $model_name = 'Products';
public $model_name = 'Invoices';
public function query(Product $model)
{
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
{
return [
Column::make('name'),
Column::make('alias'),
Column::make('latin'),
Column::computed('action')
->exportable(false)
->printable(false)

View File

@@ -1,14 +1,14 @@
<?php
namespace App\DataTables;
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\Product;
use App\Models\Shop\Order;
class ProductsDataTable extends DataTable
class OrdersDataTable extends DataTable
{
public $model_name = 'Products';
public $model_name = 'Orders';
public function query(Product $model)
{
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
{
return [
Column::make('name'),
Column::make('alias'),
Column::make('latin'),
Column::computed('action')
->exportable(false)
->printable(false)