diff --git a/.env.example b/.env.example index 6378442f..a507aff6 100644 --- a/.env.example +++ b/.env.example @@ -56,6 +56,14 @@ MAIL_PASSWORD=null MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" +MAIL_LIST_BREEDER= +MAIL_LIST_COMMITMENTS= +MAIL_LIST_EXPORT= +MAIL_LIST_FINANCE= +MAIL_LIST_INFO= +MAIL_LIST_PRESS= +MAIL_LIST_RESTAURATION= + VITE_APP_NAME="${APP_NAME}" # TELESCOPE diff --git a/app/Enums/Contact/ContactFormType.php b/app/Enums/Contact/ContactFormType.php index dfb86401..6b1db879 100644 --- a/app/Enums/Contact/ContactFormType.php +++ b/app/Enums/Contact/ContactFormType.php @@ -49,34 +49,16 @@ enum ContactFormType: int { // phpcs:enable return match ($this) { - self::collaborator => [], - self::breeder => [ - 'marie-charlotte.garnier@ldc.fr', - 'dylan.chevalier@ldc.fr', - ], - self::professional => null, - self::restauration => [ - 'rhd@ldc.fr', - ], - self::export => [ - 'alexis.lambert@ldc.fr', - 'bruno.lafon@ldc.fr', - ], - self::finance => [ - 'david.eluaud@ldc.fr', - 'malaury.offe@ldc.fr', - ], - self::commitments => [ - 'claire-marie.gesland@ldc.fr', - ], - self::product => [], - self::info => [ - 'blandine.durand-gratian@ldc.fr', - 'malaury.offe@ldc.fr', - ], - self::press => [ - 'communicationgroupe@ldc.fr', - ], + self::breeder => config('mail.to.breeder'), + self::restauration => config('mail.to.restauration'), + self::export => config('mail.to.export'), + self::finance => config('mail.to.finance'), + self::commitments => config('mail.to.commitments'), + self::info => config('mail.to.info'), + self::press => config('mail.to.press'), + self::collaborator, + self::product, + self::professional => null // phpcs:ignore Squiz.Commenting.InlineComment }; //end match } diff --git a/app/Models/News.php b/app/Models/News.php index e6f01306..d0a58ac2 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -67,7 +67,6 @@ class News extends Model implements TranslatableModel, LocalizedUrlRoutable, Sit use HasFactory; use HasTranslations; use SoftDeletes; - use HasCache; use HasUwilImages { HasUwilImages::inertiaFill as traitInertiaFill; } @@ -528,7 +527,7 @@ class News extends Model implements TranslatableModel, LocalizedUrlRoutable, Sit 'newsables', 'news_id', 'newsable_id' - ); + )->using(Newsable::class); } /** @@ -544,6 +543,6 @@ class News extends Model implements TranslatableModel, LocalizedUrlRoutable, Sit 'newsables', 'news_id', 'newsable_id' - )->withTimestamps(); + )->using(Newsable::class)->withTimestamps(); } } diff --git a/app/Models/Newsable.php b/app/Models/Newsable.php new file mode 100644 index 00000000..dc488445 --- /dev/null +++ b/app/Models/Newsable.php @@ -0,0 +1,35 @@ + $newsable_type Class of the category or tag. + * @property-read \Carbon\Carbon $created_at Created date of the news. + * @property-read \Carbon\Carbon $updated_at Updated date of the news. + */ +class Newsable extends MorphPivot +{ + /** + * The table associated with the model. + * + * @var string|null + */ + protected $table = 'newsables'; + + /** + * Perform any actions required after the model boots. + * + * @return void + */ + protected static function booted(): void + { + static::created(fn() => News::resetCache()); + static::updated(fn() => News::resetCache()); + static::deleted(fn() => News::resetCache()); + } +} diff --git a/config/mail.php b/config/mail.php index 91a4e637..4329f6b6 100644 --- a/config/mail.php +++ b/config/mail.php @@ -114,4 +114,14 @@ return [ 'name' => env('MAIL_FROM_NAME', 'Example'), ], + 'to' => [ + 'breeder' => explode(',', env('MAIL_LIST_BREEDER')) ?? [], + 'commitments' => explode(',', env('MAIL_LIST_COMMITMENTS')) ?? [], + 'export' => explode(',', env('MAIL_LIST_EXPORT')) ?? [], + 'finance' => explode(',', env('MAIL_LIST_FINANCE')) ?? [], + 'info' => explode(',', env('MAIL_LIST_INFO')) ?? [], + 'press' => explode(',', env('MAIL_LIST_PRESS')) ?? [], + 'restauration' => explode(',', env('MAIL_LIST_RESTAURATION')) ?? [], + ] + ]; diff --git a/manifest.yaml b/manifest.yaml index 10b191eb..8beb5eb9 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -23,6 +23,13 @@ data: MAIL_ENCRYPTION: "${APP_MAIL_ENCRYPTION}" MAIL_FROM_ADDRESS: "${APP_MAIL_FROM_ADDRESS}" MAIL_FROM_NAME: "${APP_APP_NAME}" + MAIL_LIST_BREEDER: "${APP_MAIL_LIST_BREEDER}" + MAIL_LIST_COMMITMENTS: "${APP_MAIL_LIST_COMMITMENTS}" + MAIL_LIST_EXPORT: "${APP_MAIL_LIST_EXPORT}" + MAIL_LIST_FINANCE: "${APP_MAIL_LIST_FINANCE}" + MAIL_LIST_INFO: "${APP_MAIL_LIST_INFO}" + MAIL_LIST_PRESS: "${APP_MAIL_LIST_PRESS}" + MAIL_LIST_RESTAURATION: "${APP_MAIL_LIST_RESTAURATION}" SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}" TELESCOPE_ENABLED: "${APP_TELESCOPE_ENABLED}" CRM_ENDPOINT: "${APP_CRM_ENDPOINT}" diff --git a/public/assets/img/logo_en.png b/public/assets/img/logo_en.png deleted file mode 100644 index 2acc43f8..00000000 Binary files a/public/assets/img/logo_en.png and /dev/null differ diff --git a/resources/assets/images/front/logo-en.png b/resources/assets/images/front/logo-en.png new file mode 100644 index 00000000..0cfcab16 Binary files /dev/null and b/resources/assets/images/front/logo-en.png differ diff --git a/resources/views/components/front/pages/commitments/commitment-4.blade.php b/resources/views/components/front/pages/commitments/commitment-4.blade.php index 45eeddb0..80db1bbd 100644 --- a/resources/views/components/front/pages/commitments/commitment-4.blade.php +++ b/resources/views/components/front/pages/commitments/commitment-4.blade.php @@ -24,10 +24,16 @@ 'image' => [ ['url' => $item['image_visual']] ], + 'button' => !empty($item['list_button']) ? [ + 'url' => \App\Models\Document::getAccessModel($item['list_button'][0]['model_document']), + 'target' => '_blank', + 'title' => $item['list_button'][0]['string_label'], + ] : null, + 'button_icon' => !empty($item['list_button']) ? 'btn__icon_dl' : null ]; })->toArray(); @endphp - {{ $document['name'] }} diff --git a/resources/views/front/layouts/header.blade.php b/resources/views/front/layouts/header.blade.php index 4c415652..d8292c0b 100644 --- a/resources/views/front/layouts/header.blade.php +++ b/resources/views/front/layouts/header.blade.php @@ -171,7 +171,7 @@ @else @endif diff --git a/resources/views/front/layouts/mobile-menu.blade.php b/resources/views/front/layouts/mobile-menu.blade.php index f416f5a3..859aa054 100644 --- a/resources/views/front/layouts/mobile-menu.blade.php +++ b/resources/views/front/layouts/mobile-menu.blade.php @@ -3,7 +3,13 @@
- +