Merge branch 'issue-57' into php-stan-issues-48-57

This commit is contained in:
Noah Lancien 2024-01-26 13:09:38 +01:00
commit 19f6454ea3
5 changed files with 152 additions and 148 deletions

View file

@ -45,9 +45,9 @@ class ContactRequest extends FormRequest
'society' => 'sometimes|nullable|string|between:3,255',
'email' => 'required|email:rfc,strict,dns,spoof,filter|max:255',
'phone' => 'sometimes|nullable|numeric|min:0',
'address' => 'sometimes|nullable|string|between:3,255',
'postal_code' => 'sometimes|nullable|numeric|min:0',
'city' => 'sometimes|nullable|string|between:3,255',
'address' => 'required|string|between:3,255',
'postal_code' => 'required|numeric|min:0',
'city' => 'required|string|between:3,255',
'object' => ['required', new Enum(ObjectEnum::class)],
'message' => 'required|string|between:3,500',
'accept_rules' => 'required|boolean',
@ -69,7 +69,7 @@ class ContactRequest extends FormRequest
}
],
'product_date_limit' => [
'string', 'between:3,255', 'required',
'required', 'date',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
if ($this->get("object") != ObjectEnum::customerService->value()) {
@ -108,7 +108,7 @@ class ContactRequest extends FormRequest
}
],
'product_date_consumption' => [
'string', 'between:3,255', 'required',
'required', 'date',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
if ($this->get("object") != ObjectEnum::customerService->value()) {

View file

@ -224,69 +224,70 @@ return [
'female' => 'of the ',
'vowel' => 'of the '
],
'accept_rules' => 'acceptation of rules',
'activated' => 'activated',
'attribute_alt' => 'alt attribute',
'attribute_title' => 'title attribute',
'background' => 'background',
'category' => 'category',
'category' => 'category',
'civility' => 'civility',
'cooking_advice' => 'cooking advice',
'description' => 'description',
'direction' => 'direction',
'event' => 'event',
'file' => 'file',
'ingredients' => 'ingredients',
'job' => 'job',
'key_earth_1' => 'key number for "respect the earth" 1',
'key_earth_2' => 'key number for "respect the earth" 2',
'key_feed' => 'key number for "feed well"',
'key_territory' => 'key number for "integrate its territory"',
'key_together_1' => 'key number for "live together" 1',
'key_together_2' => 'key number for "live together" 2',
'key_together_3' => 'key number for "live together" 3',
'key_together_4' => 'key number for "live together" 4',
'model' => 'target element',
'nutritionnal_values' => 'nutritionnal values',
'object' => 'object',
'order' => 'order',
'picture_1' => 'picture one',
'picture_2' => 'picture two',
'picture_3' => 'picture three',
'picture_alt' => 'attribut alt of the :field',
'picture_ambiance' => 'ambiance picture',
'picture_packshot' => 'packshot picture',
'picture_productsheet' => 'productsheet picture',
'picture_thumbnail' => 'thumbnail',
'picture_title' => 'attribut title of the :field',
'picture' => 'picture',
'presentation_content' => 'presentation content',
'presentation_title' => 'presentation title',
'product_barcode' => 'product barcode',
'product_date_consumption' => 'product date consumption',
'product_date_limit' => 'product date limit',
'product_location' => 'product location',
'product_lot' => 'product lot',
'product_name' => 'product name',
'publication' => 'publication',
'publish_at' => 'publication date',
'publish_at' => 'publication date',
'send_data' => 'autorization to send data',
'seo_description' => 'SEO description',
'seo_title' => 'SEO title',
'seo' => 'SEO',
'society' => 'society',
'static_page_type' => 'static page type',
'statut' => 'statut',
'subtitle' => 'subtitle',
'tagline' => 'tagline',
'target' => 'target',
'title_part1' => 'title part one',
'title_part2' => 'title part two',
'title_part3' => 'title part three',
'unpublish_at' => 'end of publication date',
'unpublish_at' => 'end of publication date',
'video_id' => 'ID of the video',
'accept_rules' => 'acceptation of rules',
'activated' => 'activated',
'attribute_alt' => 'alt attribute',
'attribute_title' => 'title attribute',
'background' => 'background',
'category' => 'category',
'category' => 'category',
'civility' => 'civility',
'cooking_advice' => 'cooking advice',
'description' => 'description',
'direction' => 'direction',
'event' => 'event',
'file' => 'file',
'ingredients' => 'ingredients',
'job' => 'job',
'key_earth_1' => 'key number for "respect the earth" 1',
'key_earth_2' => 'key number for "respect the earth" 2',
'key_feed' => 'key number for "feed well"',
'key_territory' => 'key number for "integrate its territory"',
'key_together_1' => 'key number for "live together" 1',
'key_together_2' => 'key number for "live together" 2',
'key_together_3' => 'key number for "live together" 3',
'key_together_4' => 'key number for "live together" 4',
'model' => 'target element',
'nutritionnal_values' => 'nutritionnal values',
'object' => 'object',
'order' => 'order',
'picture_1' => 'picture one',
'picture_2' => 'picture two',
'picture_3' => 'picture three',
'picture_alt' => 'attribut alt of the :field',
'picture_ambiance' => 'ambiance picture',
'picture_packshot' => 'packshot picture',
'picture_productsheet' => 'productsheet picture',
'picture_thumbnail' => 'thumbnail',
'picture_title' => 'attribut title of the :field',
'picture' => 'picture',
'presentation_content' => 'presentation content',
'presentation_title' => 'presentation title',
'product_barcode' => 'product barcode',
'product_barcode_detail' => '(13 digits)',
'product_date_consumption' => 'product date consumption',
'product_date_limit' => 'product date limit',
'product_location' => 'product location',
'product_lot' => 'product lot',
'product_name' => 'product name',
'publication' => 'publication',
'publish_at' => 'publication date',
'publish_at' => 'publication date',
'send_data' => 'autorization to send data',
'seo_description' => 'SEO description',
'seo_title' => 'SEO title',
'seo' => 'SEO',
'society' => 'society',
'static_page_type' => 'static page type',
'statut' => 'statut',
'subtitle' => 'subtitle',
'tagline' => 'tagline',
'target' => 'target',
'title_part1' => 'title part one',
'title_part2' => 'title part two',
'title_part3' => 'title part three',
'unpublish_at' => 'end of publication date',
'unpublish_at' => 'end of publication date',
'video_id' => 'ID of the video',
],
];

View file

@ -226,72 +226,73 @@ return [
'female' => 'de la ',
'vowel' => 'de l\''
],
'accept_rules' => 'acceptation des règles',
'activated' => 'activé',
'attribute_alt' => 'attribut alt',
'attribute_title' => 'attribut title',
'background' => 'fond',
'category' => 'catégorie',
'category' => 'catégorie',
'civility' => 'civilité',
'cooking_advice' => 'conseil de réchauffage',
'description' => 'description',
'direction' => 'direction',
'event' => 'évènement',
'file' => 'fichier',
'ingredients' => 'ingrédients',
'job' => 'métier',
'key_earth_1' => 'Chiffre clé "respecter la terre" 1',
'key_earth_2' => 'Chiffre clé "respecter la terre" 2',
'key_feed' => 'chiffre clé "bien nourrir"',
'key_territory' => 'Chiffre clé "intégrer son territoire"',
'key_together_1' => 'Chiffre clé "vivre ensemble" 1',
'key_together_2' => 'Chiffre clé "vivre ensemble" 2',
'key_together_3' => 'Chiffre clé "vivre ensemble" 3',
'key_together_4' => 'Chiffre clé "vivre ensemble" 4',
'model' => 'élément ciblé',
'nutritionnal_values' => 'valeurs nutritionnelles',
'object' => 'objet',
'order' => 'ordre',
'picture_1' => 'image une',
'picture_2' => 'image deux',
'picture_3' => 'image trois',
'picture_alt' => 'attribut alt de l\':field',
'picture_ambiance' => 'image d\'ambiance',
'picture_packshot' => 'image du packshot',
'picture_productsheet' => 'image de la fiche produit',
'picture_thumbnail' => 'vignette',
'picture_title' => 'attribut title de l\':field',
'picture' => 'image',
'presentation_content' => 'contenu de présentation',
'presentation_title' => 'titre de présentation',
'product_barcode' => 'le code barre du produit',
'product_date_consumption' => 'date de consommation',
'product_date_limit' => 'date de limite de consommation',
'product_location' => 'le lieu de l\'achat',
'product_lot' => 'numéro du lot figurant à côté de la date',
'product_name' => 'nom du produit',
'publication' => 'publication',
'publish_at' => 'date de publication',
'published' => 'état de publication',
'send_data' => 'autorisation d\'enregistrer des données',
'seo_description' => 'description SEO',
'seo_title' => 'titre SEO',
'seo' => 'référencement SEO',
'society' => 'société',
'static_page_type' => 'type de page',
'statut' => 'statut',
'subtitle' => 'sous-titre',
'tagline' => 'phrase d\'accroche',
'target' => 'cible',
'title_part1' => 'première partie du titre',
'title_part2' => 'seconde partie du titre',
'title_part3' => 'dernière partie du titre',
'type' => 'type',
'unpublish_at' => 'date de fin de publication',
'unpublish_at' => 'date de fin de publication',
'video_id' => 'ID de la vidéo',
'youtube_video_id' => 'ID de la vidéo youtube',
'display_video' => 'affichage de la vidéo',
'accept_rules' => 'acceptation des règles',
'activated' => 'activé',
'attribute_alt' => 'attribut alt',
'attribute_title' => 'attribut title',
'background' => 'fond',
'category' => 'catégorie',
'category' => 'catégorie',
'civility' => 'civilité',
'cooking_advice' => 'conseil de réchauffage',
'description' => 'description',
'direction' => 'direction',
'event' => 'évènement',
'file' => 'fichier',
'ingredients' => 'ingrédients',
'job' => 'métier',
'key_earth_1' => 'Chiffre clé "respecter la terre" 1',
'key_earth_2' => 'Chiffre clé "respecter la terre" 2',
'key_feed' => 'chiffre clé "bien nourrir"',
'key_territory' => 'Chiffre clé "intégrer son territoire"',
'key_together_1' => 'Chiffre clé "vivre ensemble" 1',
'key_together_2' => 'Chiffre clé "vivre ensemble" 2',
'key_together_3' => 'Chiffre clé "vivre ensemble" 3',
'key_together_4' => 'Chiffre clé "vivre ensemble" 4',
'model' => 'élément ciblé',
'nutritionnal_values' => 'valeurs nutritionnelles',
'object' => 'objet',
'order' => 'ordre',
'picture_1' => 'image une',
'picture_2' => 'image deux',
'picture_3' => 'image trois',
'picture_alt' => 'attribut alt de l\':field',
'picture_ambiance' => 'image d\'ambiance',
'picture_packshot' => 'image du packshot',
'picture_productsheet' => 'image de la fiche produit',
'picture_thumbnail' => 'vignette',
'picture_title' => 'attribut title de l\':field',
'picture' => 'image',
'presentation_content' => 'contenu de présentation',
'presentation_title' => 'titre de présentation',
'product_barcode' => 'code barre du produit',
'product_barcode_detail' => '(13 chiffres)',
'product_date_consumption' => 'date de consommation',
'product_date_limit' => 'date de limite de consommation',
'product_location' => 'le lieu de l\'achat',
'product_lot' => 'numéro du lot figurant à côté de la date',
'product_name' => 'nom du produit',
'publication' => 'publication',
'publish_at' => 'date de publication',
'publish_at' => 'date de publication',
'send_data' => 'autorisation d\'enregistrer des données',
'seo_description' => 'description SEO',
'seo_title' => 'titre SEO',
'seo' => 'référencement SEO',
'society' => 'société',
'static_page_type' => 'type de page',
'statut' => 'statut',
'subtitle' => 'sous-titre',
'tagline' => 'phrase d\'accroche',
'target' => 'cible',
'title_part1' => 'première partie du titre',
'title_part2' => 'seconde partie du titre',
'title_part3' => 'dernière partie du titre',
'type' => 'type',
'unpublish_at' => 'date de fin de publication',
'unpublish_at' => 'date de fin de publication',
'video_id' => 'ID de la vidéo',
'youtube_video_id' => 'ID de la vidéo youtube',
'display_video' => 'affichage de la vidéo',
],
];

View file

@ -28,10 +28,10 @@
### Information sur le produit:
@component('mail::panel')
- **{{ __('validation.custom.product_name') }}:** {{ $data->product_name ?? '' }}
- **{{ __('validation.custom.product_date_limit') }}:** {{ $data->product_date_limit ?? '' }}
- **{{ __('validation.custom.product_date_limit') }}:** {{ \Carbon\Carbon::make($data->product_date_limit)->format('d/m/Y') ?? '' }}
- **{{ __('validation.custom.product_barcode') }}:** {{ $data->product_barcode ?? '' }}
- **{{ __('validation.custom.product_lot') }}:** {{ $data->product_lot ?? '' }}
- **{{ __('validation.custom.product_date_consumption') }}:** {{ $data->product_date_consumption ?? '' }}
- **{{ __('validation.custom.product_date_consumption') }}:** {{ \Carbon\Carbon::make($data->product_date_consumption)->format('d/m/Y') ?? '' }}
- **{{ __('validation.custom.product_location') }}:** {{ $data->product_location ?? '' }}
@endcomponent
@endif

View file

@ -79,20 +79,20 @@
</div>
<div class="col-12 col-md-6 p-0">
<fieldset class="d-flex flex-column justify-content-center align-items-start pe-md-5">
<label class="mt-1">{{ Str::of(__('validation.attributes.address'))->ucFirst() }}&nbsp;:</label>
<input class="form-control" name="address" value="{{ old('address') }}">
<label class="mt-1">{{ Str::of(__('validation.attributes.address'))->ucFirst() }}*&nbsp;:</label>
<input class="form-control" name="address" value="{{ old('address') }}" required>
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">
<fieldset class="d-flex flex-column justify-content-center align-items-start ps-md-5">
<label class="mt-1">{{ Str::of(__('validation.attributes.postal_code'))->ucFirst() }}&nbsp;:</label>
<input class="form-control" name="postal_code" type="number" value="{{ old('postal_code') }}">
<label class="mt-1">{{ Str::of(__('validation.attributes.postal_code'))->ucFirst() }}*&nbsp;:</label>
<input class="form-control" name="postal_code" type="number" value="{{ old('postal_code') }}" required>
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">
<fieldset class="d-flex flex-column justify-content-center align-items-start pe-md-5">
<label class="mt-1">{{ Str::of(__('validation.attributes.city'))->ucFirst()->value() }}&nbsp;:</label>
<input class="form-control" name="city" value="{{ old('city') }}">
<label class="mt-1">{{ Str::of(__('validation.attributes.city'))->ucFirst()->value() }}*&nbsp;:</label>
<input class="form-control" name="city" value="{{ old('city') }}" required>
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">
@ -126,15 +126,17 @@
<fieldset class="d-flex flex-column justify-content-center align-items-start ps-md-5">
<label class="mt-1" for="product_date_limit">
{{ Str::of(__('validation.custom.product_date_limit'))->ucFirst()->value() }}*&nbsp;:
<span class="text-body-secondary">{{ __('Ex : 25/08/2028') }}</span>
</label>
<input class="form-control" id="product_date_limit" name="product_date_limit"
<input class="form-control" id="product_date_limit" name="product_date_limit" type="date"
value="{{ old('product_date_limit') }}">
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">
<fieldset class="d-flex flex-column justify-content-center align-items-start pe-md-5">
<label class="mt-1" for="product_barcode">
{{ Str::of(__('validation.custom.product_barcode'))->ucFirst()->value() }}*&nbsp;:
{{ Str::of(__('validation.custom.product_barcode'))->ucFirst()->value() }}*
{{ __('validation.custom.product_barcode_detail') }}&nbsp;:
</label>
<input class="form-control" id="product_barcode" name="product_barcode" type="number"
value="{{ old('product_barcode') }}">
@ -156,7 +158,7 @@
<span class="text-body-secondary">{{ __('Ex : 25/08/2028') }}</span>
</label>
<input class="form-control" id="product_date_consumption" name="product_date_consumption"
value="{{ old('product_date_consumption') }}">
type="date" value="{{ old('product_date_consumption') }}">
</fieldset>
</div>
<div class="col-12 col-md-6 p-0">
@ -189,7 +191,7 @@
</fieldset>
</div>
<p class="highlight white w-100 w-xl-fit m-0 mx-auto my-5 px-5 text-center">
{{ __('Laissez nous votre message, le service consommateurs vous répondra par mail dans les plus brefs délais.') }}
{{ __('Laissez nous votre message, le service consommateurs vous répondra dans les plus brefs délais.') }}
</p>
</div>
<div class="col-12 mb-3 p-0">