Merge branch 'develop' into trunk
This commit is contained in:
commit
968ce91ee0
7 changed files with 31 additions and 13 deletions
|
|
@ -105,8 +105,8 @@ class ContactRequest extends FormRequest
|
|||
ContactFormType::export->equals(ContactFormType::make($typeContactForm))
|
||||
) {
|
||||
$rules = array_merge($rules, [
|
||||
'type' => ['array', 'min:1'],
|
||||
'type.*' => [Rule::enum(ExportAskingType::class)],
|
||||
'typeExport' => ['array', 'min:1'],
|
||||
'typeExport.*' => [Rule::enum(ExportAskingType::class)],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Models;
|
|||
use App\Enums\Contact\BreedType;
|
||||
use App\Enums\Contact\ContactFormType;
|
||||
use App\Enums\Contact\CustomerAskingType;
|
||||
use App\Enums\Contact\ExportAskingType;
|
||||
use App\Enums\Contact\PressType;
|
||||
use App\Enums\Department;
|
||||
use Illuminate\Database\Eloquent\Casts\AsEnumArrayObject;
|
||||
|
|
@ -28,6 +29,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @property string $postalcode The customer's postalcode.
|
||||
* @property boolean $newsletter The customer's optin response.
|
||||
* @property \App\Enums\Contact\CustomerAskingType[] $type The customer's type asking
|
||||
* @property \App\Enums\Contact\ExportAskingType[] $typeExport The customer's type asking
|
||||
* @property \App\Enums\Contact\PressType $subject The message's subject
|
||||
* @property-read \Carbon\Carbon $created_at Created date.
|
||||
* @property-read \Carbon\Carbon $updated_at Updated date.
|
||||
|
|
@ -60,6 +62,7 @@ class MailContactData extends Model
|
|||
'town',
|
||||
'postalcode',
|
||||
'type',
|
||||
'typeExport',
|
||||
'subject',
|
||||
'newsletter',
|
||||
];
|
||||
|
|
@ -74,6 +77,7 @@ class MailContactData extends Model
|
|||
'typeelevage' => AsEnumArrayObject::class . ':' . BreedType::class,
|
||||
'zonegeo' => AsEnumArrayObject::class . ':' . Department::class,
|
||||
'type' => AsEnumArrayObject::class . ':' . CustomerAskingType::class,
|
||||
'typeExport' => AsEnumArrayObject::class . ':' . ExportAskingType::class,
|
||||
'subject' => PressType::class,
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ return [
|
|||
'label' => 'Type',
|
||||
'placeholder' => 'Dropdown list'
|
||||
],
|
||||
'exportAskingType' => [
|
||||
'label' => 'Type',
|
||||
'placeholder' => 'Dropdown list'
|
||||
],
|
||||
'company' => [
|
||||
'label' => 'Company',
|
||||
'placeholder' => 'Your company'
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ return [
|
|||
'label' => 'Type',
|
||||
'placeholder' => 'Liste déroulante'
|
||||
],
|
||||
'exportAskingType' => [
|
||||
'label' => 'Type',
|
||||
'placeholder' => 'Liste déroulante'
|
||||
],
|
||||
'company' => [
|
||||
'label' => 'Société',
|
||||
'placeholder' => 'Votre société'
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ Téléphone : {{ $data->phone }}
|
|||
@endif
|
||||
|
||||
@if (\App\Enums\Contact\ContactFormType::breeder->equals($data->enumType))
|
||||
@if (is_array($data->typeelevage))
|
||||
@if (is_iterable($data->typeelevage))
|
||||
Type d'élevage :
|
||||
@foreach($data->typeelevage as $breeding)
|
||||
{{ $breeding->label() }}
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (is_array($data->zonegeo))
|
||||
@if (is_iterable($data->zonegeo))
|
||||
Zone géographique :
|
||||
@foreach($data->zonegeo as $zone)
|
||||
{{ $zone->label() }}
|
||||
|
|
@ -39,14 +39,20 @@ Zone géographique :
|
|||
Société : {{ $data->company }}
|
||||
@endif
|
||||
|
||||
@if (is_array($data->type) && \App\Enums\Contact\ContactFormType::restauration->equals($data->enumType) ||
|
||||
\App\Enums\Contact\ContactFormType::export->equals($data->enumType))
|
||||
@if (is_iterable($data->type) && \App\Enums\Contact\ContactFormType::restauration->equals($data->enumType))
|
||||
Type de demande :
|
||||
@foreach($data->type as $t)
|
||||
{{ $t->label() }}
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (is_iterable($data->typeExport) && \App\Enums\Contact\ContactFormType::export->equals($data->enumType))
|
||||
Type de demande :
|
||||
@foreach($data->typeExport as $t)
|
||||
{{ $t->label() }}
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (\App\Enums\Contact\ContactFormType::press->equals($data->enumType))
|
||||
Sujet : {{ $data->subject->label() }}
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
{{-- BREEDER --}}
|
||||
@if (\App\Enums\Contact\ContactFormType::breeder->equals($data->enumType))
|
||||
@if (is_array($data->typeelevage))
|
||||
@if (is_iterable($data->typeelevage))
|
||||
<p>Type d'élevage : </p>
|
||||
<ul>
|
||||
@foreach ($data->typeelevage as $breeding)
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
</ul>
|
||||
@endif
|
||||
|
||||
@if (is_array($data->zonegeo))
|
||||
@if (is_iterable($data->zonegeo))
|
||||
<p>Zone géographique : </p>
|
||||
<ul>
|
||||
@foreach ($data->zonegeo as $zone)
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<p>Société : {{ $data->company }}</p>
|
||||
@endif
|
||||
|
||||
@if (is_array($data->type) && \App\Enums\Contact\ContactFormType::restauration->equals($data->enumType))
|
||||
@if (is_iterable($data->type) && \App\Enums\Contact\ContactFormType::restauration->equals($data->enumType))
|
||||
<p>Type de demande : </p>
|
||||
<ul>
|
||||
@foreach ($data->type as $t)
|
||||
|
|
@ -64,10 +64,10 @@
|
|||
@endif
|
||||
|
||||
{{-- Export --}}
|
||||
@if (is_array($data->type) && \App\Enums\Contact\ContactFormType::export->equals($data->enumType) && $data->type)
|
||||
@if (is_iterable($data->typeExport) && \App\Enums\Contact\ContactFormType::export->equals($data->enumType) && $data->typeExport)
|
||||
<p>Type de demande : </p>
|
||||
<ul>
|
||||
@foreach ($data->type as $t)
|
||||
@foreach ($data->typeExport as $t)
|
||||
<li>{{ $t->label() }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
@endif
|
||||
|
||||
@if (\App\Enums\Contact\ContactFormType::export->equals($contactFormType))
|
||||
<x-front.inputs.multi-select placeholder="{{ ucfirst(__('front.contact.inputs.customerAskingType.placeholder')) }}"
|
||||
label="{{ ucfirst(__('front.contact.inputs.customerAskingType.label')) }}" required="true" name="type"
|
||||
<x-front.inputs.multi-select placeholder="{{ ucfirst(__('front.contact.inputs.exportAskingType.placeholder')) }}"
|
||||
label="{{ ucfirst(__('front.contact.inputs.exportAskingType.label')) }}" required="true" name="typeExport"
|
||||
:options="collect(\App\Enums\Contact\ExportAskingType::toArray())->map(function ($type) {
|
||||
return [
|
||||
'value' => $type->value,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue