fix on merchandises with validator

This commit is contained in:
ludo
2023-11-25 16:21:02 +01:00
parent 9b18531c83
commit 731c31a58c
3 changed files with 3 additions and 23 deletions

View File

@@ -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),

View File

@@ -1,21 +0,0 @@
<?php
namespace App\Http\Requests\Admin\Shop;
use Illuminate\Foundation\Http\FormRequest;
class StoreMerchandisePost extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'name' => 'required',
'producer_id' => 'required',
];
}
}

View File

@@ -98,7 +98,7 @@
initSelect2();
initChevron();
initEditor();
initSaveForm('merchandise-form');
initSaveForm('#merchandise-form');
});
</script>
@endpush