From 0ec0b8e85b2f34cfe50812c13d3d494b9f960da8 Mon Sep 17 00:00:00 2001 From: ludo Date: Sat, 25 Nov 2023 16:21:02 +0100 Subject: [PATCH] fix on merchandises with validator --- .../Admin/Shop/MerchandisesDataTable.php | 3 ++- .../Admin/Shop/StoreMerchandisesPost.php | 21 ------------------- .../Admin/Shop/Merchandises/form.blade.php | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php diff --git a/app/Datatables/Admin/Shop/MerchandisesDataTable.php b/app/Datatables/Admin/Shop/MerchandisesDataTable.php index d4742209..2eb6a7e0 100644 --- a/app/Datatables/Admin/Shop/MerchandisesDataTable.php +++ b/app/Datatables/Admin/Shop/MerchandisesDataTable.php @@ -14,7 +14,7 @@ class MerchandisesDataTable extends DataTable public function query(Merchandise $model) { - $model = $model::with(['image', 'tags'])->withCount(['Articles', 'tags', 'images']); + $model = $model::with(['image', 'tags', 'producer'])->withCount(['Articles', 'tags', 'images']); return $this->buildQuery($model); } @@ -43,6 +43,7 @@ class MerchandisesDataTable extends DataTable return [ Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'), Column::make('name')->title('Nom'), + Column::make('producer.name')->title('Producteur'), Column::make('tags2')->title('Tags')->searchable(false)->orderable(false), Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false), Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false), diff --git a/app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php b/app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php deleted file mode 100644 index 3adc6f05..00000000 --- a/app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php +++ /dev/null @@ -1,21 +0,0 @@ - 'required', - 'producer_id' => 'required', - ]; - } -} diff --git a/resources/views/Admin/Shop/Merchandises/form.blade.php b/resources/views/Admin/Shop/Merchandises/form.blade.php index d4715af1..9773c3e1 100644 --- a/resources/views/Admin/Shop/Merchandises/form.blade.php +++ b/resources/views/Admin/Shop/Merchandises/form.blade.php @@ -98,7 +98,7 @@ initSelect2(); initChevron(); initEditor(); - initSaveForm('merchandise-form'); + initSaveForm('#merchandise-form'); }); @endpush