fix on merchandises with validator
This commit is contained in:
@@ -14,7 +14,7 @@ class MerchandisesDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Merchandise $model)
|
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);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,7 @@ class MerchandisesDataTable extends DataTable
|
|||||||
return [
|
return [
|
||||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('producer.name')->title('Producteur'),
|
||||||
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
||||||
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
|
|||||||
@@ -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',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
initSelect2();
|
initSelect2();
|
||||||
initChevron();
|
initChevron();
|
||||||
initEditor();
|
initEditor();
|
||||||
initSaveForm('merchandise-form');
|
initSaveForm('#merchandise-form');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
Reference in New Issue
Block a user