diff --git a/app/Http/Requests/Bo/Products/StoreProductRequest.php b/app/Http/Requests/Bo/Products/StoreProductRequest.php index 461640e9..b2a6ac1e 100644 --- a/app/Http/Requests/Bo/Products/StoreProductRequest.php +++ b/app/Http/Requests/Bo/Products/StoreProductRequest.php @@ -60,6 +60,7 @@ class StoreProductRequest extends FormRequest 'description' => ['required', 'string', new WysiwygLength()], 'details' => ['required', 'string', new WysiwygLength()], 'preparation' => ['required', 'string', new WysiwygLength()], + 'sales_name' => ['nullable', 'string', new WysiwygLength(min: 0, max: 100)], 'ingredients' => ['required', 'string', new WysiwygLength()], 'nutritionnal_values' => 'required|array', 'nutritionnal_values.energy' => 'required|numeric|between:0,999999', @@ -219,6 +220,7 @@ class StoreProductRequest extends FormRequest 'description' => trans('validations.custom.description'), 'details' => trans('validations.custom.details'), 'preparation' => trans('validations.custom.preparation'), + 'sales_name' => trans('validation.custom.sales_name'), 'ingredients' => trans('validations.custom.ingredients'), 'approach_id' => trans('models.classes.demarche'), diff --git a/app/Models/Product.php b/app/Models/Product.php index 7c69f59b..fbd1f566 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -90,6 +90,7 @@ class Product extends Model implements RedirectableInterface, SchemaOrgInterface 'details', 'preparation', 'ingredients', + 'sales_name', 'approach_id', 'range_id', 'subrange_id', diff --git a/database/migrations/2026_10_20_160805_add_sales_name_to_products_table.php b/database/migrations/2026_10_20_160805_add_sales_name_to_products_table.php new file mode 100644 index 00000000..0b61533d --- /dev/null +++ b/database/migrations/2026_10_20_160805_add_sales_name_to_products_table.php @@ -0,0 +1,28 @@ +text('sales_name')->nullable()->comment('Product sales name.')->after('ingredients'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('products', function (Blueprint $table) { + $table->dropColumn('sales_name'); + }); + } +}; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index c8e85267..2bb42515 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -398,5 +398,6 @@ return [ 'advice_picto' => 'advice icon', 'tips_title' => 'nutrition tip title', 'tips_picto' => 'nutrition tip icon', + 'sales_name' => 'sales name', ], ]; diff --git a/resources/lang/fr/validation.php b/resources/lang/fr/validation.php index 82b5f104..9d959ff8 100644 --- a/resources/lang/fr/validation.php +++ b/resources/lang/fr/validation.php @@ -417,5 +417,6 @@ return [ 'advice_picto' => 'picto du conseil', 'tips_title' => 'titre de l\'astuce nutrition', 'tips_picto' => 'picto de l\'astuce nutrition', + 'sales_name' => 'dénomination de vente', ], ]; diff --git a/resources/views/bo/pages/products/form.blade.php b/resources/views/bo/pages/products/form.blade.php index e3de07d0..b134cb56 100644 --- a/resources/views/bo/pages/products/form.blade.php +++ b/resources/views/bo/pages/products/form.blade.php @@ -235,6 +235,35 @@ {{-- INGREDIENTS --}} +
+
+ {{ str(__('validation.custom.sales_name'))->ucfirst() }} +
+
+ @include('bo.partials.inputs.text-html', [ + 'id' => 'productSalesName', + 'label' => str( + __(':field :inter:model', [ + 'field' => str(__('validation.custom.sales_name')), + 'inter' => __('validation.custom.of_the.male'), + 'model' => __('models.classes.product'), + ]))->ucfirst(), + 'name' => 'sales_name', + 'model' => $productModel ?? null, + 'required' => false, + 'helper' => + __('crud.minicrud.text_warning') . + ' ' . + __('validation.min.string', [ + 'attribute' => str(__('validation.custom.sales_name')), + 'min' => 0, + ]), + ]) +
+
+
+
+ {{-- INGREDIENTS --}}
{{ str(__('validation.custom.ingredient'))->ucfirst()->plural() }} diff --git a/resources/views/fo/pages/products/show.blade.php b/resources/views/fo/pages/products/show.blade.php index 4ca7dd84..a146b0ac 100644 --- a/resources/views/fo/pages/products/show.blade.php +++ b/resources/views/fo/pages/products/show.blade.php @@ -265,6 +265,12 @@ title="{{ __('Bouton de fermeture de la modale') }}" alt="{{ __('Croix marron') }}">