feat: ✨ set home in dynamic page

This commit is contained in:
Alexis Gousseau 2026-01-06 09:53:08 +01:00
parent 24ebc851f9
commit fcd30ee23b
27 changed files with 368 additions and 769 deletions

View file

@ -14,17 +14,6 @@ use Uwil\LaravelCommon\Controllers\Controller;
class HomeController extends Controller
{
/**
* Show home page.
*
* @return \Illuminate\Contracts\View\View
*/
public function homepage(): \Illuminate\Contracts\View\View
{
return view('front.pages.home');
}
/**
* unsubscribeNewsletter method
*

View file

@ -34,6 +34,8 @@ class StoreDynamicPageRequest extends UpdateDynamicFieldRequest
$this->merge([
'config_id' => $this->config_id != 0 ? $this->config_id : null,
'isLocked' => $this->boolean('isLocked'),
'isRoot' => $this->boolean('isRoot'),
'slug' => $this->boolean('isRoot') ? "" : $this->slug,
]);
if ($this->config_id) {
parent::prepareForValidation();
@ -50,12 +52,19 @@ class StoreDynamicPageRequest extends UpdateDynamicFieldRequest
{
$rules = [
'title' => 'required|string|between:3,255',
'slug' => 'required|string|regex:/^[-A-Za-z0-9]{3,255}$/',
'page_id' => 'sometimes|nullable|numeric|exists:dynamic_pages,id',
'config_id' => 'sometimes|nullable|numeric|exists:page_configs,id',
'status' => ['required', new Enum(PageStatusEnum::class)],
'isLocked' => 'required|boolean',
'isRoot' => 'required|boolean',
];
if ($this->boolean('isRoot')) {
$rules['slug'] = ['present', 'nullable'];
} else {
$rules['slug'] = ['required', 'string', 'regex:/^[-A-Za-z0-9]{3,255}$/'];
}
if ($this->config_id) {
$rules = \array_merge(
['content' => 'required|array|min:1'],
@ -67,6 +76,7 @@ class StoreDynamicPageRequest extends UpdateDynamicFieldRequest
'content' => ['required', 'string', new WysiwygLength()],
], $rules);
}
return $rules;
}
@ -83,6 +93,7 @@ class StoreDynamicPageRequest extends UpdateDynamicFieldRequest
'config_id' => trans_choice('models.classes.page-config', 1),
'status' => trans('validation.custom.status'),
'isLocked' => trans('validation.custom.locked'),
'isRoot' => trans('validation.custom.root'),
];
if ($this->config_id) {
$attributes = \array_merge(

View file

@ -31,6 +31,7 @@ use Uwil\LaravelCommon\Helpers\FileHelper;
* @property integer|null $page_id Page associated to the dynamic page.
* @property \App\Enums\DynamicPages\PageStatusEnum $status Status of the dynamic page.
* @property boolean $isLocked Locked status of dynamic page.
* @property boolean $isRoot Root status of dynamic page.
* @property-read \Illuminate\Support\Carbon $created_at Date on which the dynamic page was created.
* @property-read \Illuminate\Support\Carbon $updated_at Date on which the dynamic page was updated.
* @property-read \Illuminate\Support\Carbon $deleted_at Date on which the dynamic page was updated.
@ -58,6 +59,7 @@ class DynamicPage extends Model implements TranslatableModel
'config_id',
'status',
'isLocked',
'isRoot',
];
/**
@ -69,6 +71,7 @@ class DynamicPage extends Model implements TranslatableModel
'content' => 'array',
'status' => PageStatusEnum::class,
'isLocked' => 'boolean',
'isRoot' => 'boolean',
];
/**
@ -122,6 +125,7 @@ class DynamicPage extends Model implements TranslatableModel
]);
}
$model->status = PageStatusEnum::draft;
$model->isRoot = false;
});
static::forceDeleted(function (self $model) {
// TODO: update this after recursive deleting images.
@ -223,14 +227,33 @@ class DynamicPage extends Model implements TranslatableModel
private static function manageFields(self $model): void
{
// Check unique fields.
$slug = $model->slug ?? Str::slug($model->title);
TranslationHelper::assertTranslationFieldIsUnique($model, $model->title, 'title');
TranslationHelper::assertTranslationFieldIsUnique($model, $slug, 'slug');
$model->setAttribute('slug', $slug);
if($model->isRoot) {
self::assertRootIsUnique($model);
} else {
$slug = $model->slug ?? Str::slug($model->title);
TranslationHelper::assertTranslationFieldIsUnique($model, $model->title, 'title');
TranslationHelper::assertTranslationFieldIsUnique($model, $slug, 'slug');
$model->setAttribute('slug', $slug);
}
// Check translations.
self::validateFallbackTranslations($model);
}
/**
* Assert there is only one root page.
*
* @param self $model
* @return void
*/
public static function assertRootIsUnique(self $model): void
{
$oldDynamicPageRoot = self::getModelsCached()->where('isRoot', true)->first();
if ($oldDynamicPageRoot) {
$oldDynamicPageRoot->isRoot = false;
$oldDynamicPageRoot->saveQuietly();
}
}
/**
* Assert fallback locale translation is present.
*

View file

@ -53,7 +53,7 @@ class DynamicPageRouteServiceProvider extends ServiceProvider
$slug = $dynamicPageModel->getTranslation('slug', $locale);
// If no slug for the locale → skip.
if (!$slug) continue;
if (!empty($slug) && !$slug) continue;
// Retrieves the parent segments for this locale.
$segments = DynamicPageHelper::getAllDynamicPageSegments(

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::table('dynamic_pages', function (Blueprint $table) {
$table->boolean('isRoot')->default(false)->comment('Page root status.')->after('isLocked');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('dynamic_pages', function (Blueprint $table) {
$table->dropColumn('isRoot');
});
}
};

View file

@ -86,6 +86,8 @@ return [
"form_subtitle_visibility" => "Manage account display.",
"form_title_isLocked" => "Restriction",
"form_subtitle_isLocked" => "Manage page locking.",
"form_title_page_accessibility" => "Accessibility",
"form_subtitle_page_accessibility" => "Manage access the dynamic page of the site.",
"form_associate_to" => ":attribute associated to this model|:attribute associated to this model",
"form_associate_to_plural" => ":attribute associated to this model|:attribute associated to this model",
"form_title_config" => "Setup",
@ -124,6 +126,7 @@ return [
"list_children_needed" => "Children are required for this type :enumLabel",
"empty_warning" => "No data recorded",
"page_locked" => "This page is currently locked",
"page_root" => "This page is currently home",
"unsupported_type" => "Unsupported type:",
"missing_translations" => "The translation of the :field for the language :locales is missing.|The translation
of the :field for :locales languages are missing.",

View file

@ -4,6 +4,7 @@ return [
"multiple_choice" => 'multiple choice',
"required_field" => 'compulsory fields',
"go_to_the_back_end" => "access the back-office",
"back_to_homepage" => "Back to the homepage",
"homepage" => "LDC",
"nos-engagements" => [
'key' => "Presentation of our commitments",

View file

@ -240,6 +240,7 @@ return [
"validation" => "validation",
"reference" => "reference",
"locked" => "locked",
"root" => "root",
"field" => "field",
"key" => "unique key",
"slug" => "slug",

View file

@ -85,6 +85,8 @@ return [
"form_subtitle_visibility" => "Gérer l'affichage du compte.",
"form_title_isLocked" => "Restriction",
"form_subtitle_isLocked" => "Gérer le vérouillage de la page.",
"form_title_page_accessibility" => "Accessibilité",
"form_subtitle_page_accessibility" => "Gérer l’accès à la page dynamique du site.",
"form_associate_to" => ":attribute associé au modèle|:attribute associée au modèle",
"form_associate_to_plural" => ":attribute associés au modèle|:attribute associées au modèle",
"form_title_config" => "Réglage",
@ -124,6 +126,7 @@ return [
"list_children_needed" => "Des enfants sont nécessaires pour ce type :enumLabel",
"empty_warning" => "Aucune donnée enregistrée",
"page_locked" => "Cette page est actuellement vérouillée",
"page_root" => "Cette page est actuellement l'accueil",
"unsupported_type" => "Type non supporté:",
"missing_translations" => "La traduction du champs :field pour la langue :locales est manquante.|La traduction
du champs :field pour l es langues :locales sont manquantes.",

View file

@ -4,6 +4,7 @@ return [
"multiple_choice" => 'choix multiple',
"required_field" => 'champs obligatoires',
"go_to_the_back_end" => "accéder au back-office",
"back_to_homepage" => "Revenir à la page d'accueil",
"homepage" => "LDC",
"nos-engagements" => "nos engagements",
"nos-engagements" => [

View file

@ -240,6 +240,7 @@ return [
"validation" => "validation",
"reference" => "référence",
"locked" => "vérouillé",
"root" => "page racine (accueil)",
"field" => "champs",
"key" => "clé",
"slug" => "chemin d'accès",

View file

@ -244,6 +244,16 @@ export default function ModelSelect({
return () => clearTimeout(handler);
}, [search, targetModel, field]);
// Update when selected is updated.
useEffect(() => {
if (selected !== null) {
handleSelect(selected);
} else {
setSelectedId(null);
setSelectedValue(null);
}
}, [selected]);
return (
<div className="flex flex-col w-full gap-1.5">
<Label htmlFor={name}>

View file

@ -9,9 +9,10 @@ interface Props {
value: string
targetValue: string
wordCounter?: boolean;
disabled?: boolean,
}
const Slugifycator = (props: Props) => {
const {value, targetValue, setData, wordCounter = false} = props;
const {value, targetValue, setData, wordCounter = false, disabled = false} = props;
return (
<div className="flex items-end gap-1">
<SimpleString
@ -28,6 +29,7 @@ const Slugifycator = (props: Props) => {
wordCounter={wordCounter}
value={value}
setData={setData}
disabled={disabled}
/>
<BtnOptionnalLinkWithTooltip
content={<GavelIcon className="w-4 h-4 m-auto" />}
@ -35,6 +37,7 @@ const Slugifycator = (props: Props) => {
type="button"
variant="secondary"
onClick={() => setData("slug", str(targetValue).slug().value())}
disabled={disabled}
/>
</div>
)

View file

@ -102,7 +102,7 @@ export default function AppSidebar() {
},
{
title: useTrans("back.your_website"),
link: route("front.homepage"),
link: route("front.dynamic-pages.accueil." + appEnv.locale),
show: true,
icon: SquareArrowOutUpRightIcon,
},

View file

@ -1,6 +1,6 @@
// * Packages
import { useForm, usePage } from "@inertiajs/react";
import { BookTextIcon, CogIcon, EyeIcon, GavelIcon, ShieldAlertIcon } from "lucide-react";
import { AwardIcon, BookTextIcon, CogIcon, EyeIcon, GavelIcon, ShieldAlertIcon } from "lucide-react";
import { route } from "ziggy-js";
import { useEffect, useState } from "react";
// * Components shadcn
@ -125,6 +125,7 @@ export default function Form({
config_id: model?.config_id ?? configOptions[defaultConfigId].id,
status: model?.status ?? enumDynamicPageStatus.draft.value,
isLocked: model?.isLocked ?? false,
isRoot: model?.isRoot ?? false,
});
const submit = useCrudSubmit({
@ -227,6 +228,27 @@ export default function Form({
selected={data.status}
setData={setData}
/>
</FieldsetWrapper>
<FieldsetWrapper
title={useTrans("back.form_title_page_accessibility")}
icon={<AwardIcon className="mr-1" />}
description={useTrans("back.form_subtitle_page_accessibility")}
className="sm:grid-cols-2 gap-4"
>
<div className="col-span-2">
<SimpleSwitch
label={str(useTrans("validation.custom.root")).ucFirst().value()}
name="isRoot"
checked={data.isRoot}
setData={(name, value) => {
setSelectedGroup(null);
setData("page_id", null);
setData("slug", "");
// @ts-ignore
setData(name, value);
}}
/>
</div>
<ModelSelect
name="page_id"
targetModel="dynamic_pages"
@ -242,21 +264,23 @@ export default function Form({
.ucFirst()
.value()}
placeholder="ex: "
selected={data.page_id}
selected={!data.isRoot ? data.page_id : null}
exclude={model?.id}
required={false}
setData={setData}
onSelectValue={(value) => setSelectedGroup((value as DynamicPageModel).title[locale])}
onSelectValue={(value) => setSelectedGroup((value !== null) ? (value as DynamicPageModel).title[locale] : null)}
disabled={data.isRoot}
/>
<Slugifycator
value={data.slug}
value={!data.isRoot ? data.slug : ""}
targetValue={data.title}
setData={setData}
disabled={data.isRoot}
/>
<div className="col-span-1 md:col-span-2">
<GoToFrontView
modelName={useTrans(`models.classes.${modelName}`, { choice: 1 })}
pathField={data.slug}
pathField={!data.isRoot ? data.slug : ""}
additionalGroupPath={getFullSlugPath(dynamicPageModels, selectedGroup, locale) ?? undefined}
isAvailable={model?.status === enumDynamicPageStatus.published.value}
/>

View file

@ -4,6 +4,7 @@ import {
AlertCircleIcon,
ArchiveIcon,
ArrowLeftIcon,
AwardIcon,
CogIcon,
LockIcon,
PlusIcon,
@ -41,7 +42,6 @@ import {
import str from "@/hooks/use-string";
import useTrans from "@/hooks/use-translations";
import DynamicStatusBadge from "@/back/Components/DynamicPages/DynamicStatusBadge";
import { ReactNode } from "react";
import { renderTranslationCell } from "@/lib/translationCellFallback";
export default function Index({
@ -80,12 +80,21 @@ export default function Index({
field={column.id}
/>
),
cell: ({ row }: { row: Row<DynamicPageModel> }) => {
return renderTranslationCell(
row.getValue("title") as TranslationField
);
}
cell: ({ row }: { row: Row<DynamicPageModel> }) => (
<div className="flex justify-center items-center">
{renderTranslationCell(row.getValue("title") as TranslationField)}
{row.original.isRoot && (
<Tooltip>
<TooltipTrigger asChild>
<AwardIcon size={15} className="ms-1" />
</TooltipTrigger>
<TooltipContent>
{useTrans("back.page_root")}
</TooltipContent>
</Tooltip>
)}
</div>
),
},
{
accessorKey: "parent_page",

View file

@ -136,6 +136,19 @@ export default function Show({ data, modelName }: { data: SingleResource, modelN
</Badge>
),
},
{
accessorKey: "isRoot",
header: str(useTrans("validation.custom.root")).ucFirst().value(),
cell: ({ value }: { value: boolean }) => (
<Badge
variant="outline"
className={`border-0 ${value ? "bg-green-200 dark:bg-green-900" : "bg-red-200 dark:bg-red-900"}`}
>
{value ? <CheckIcon size={15} className="mr-1" /> : <XIcon size={15} className="mr-1" />}
{str(useTrans(value ? "back.yes" : "back.no")).ucFirst().value()}
</Badge>
),
},
{
accessorKey: "created_at",
header: str(useTrans("validation.attributes.created_at")).ucFirst().value(),

View file

@ -1,6 +1,6 @@
// * Packages
import { route } from "ziggy-js";
import { Head, Link } from "@inertiajs/react";
import { Head, Link, usePage } from "@inertiajs/react";
// * Components shadcn
import { TooltipProvider } from "@/components/ui/tooltip";
import { Button } from "@/components/ui/button";
@ -9,8 +9,10 @@ import { ThemeProvider } from "@/back/providers/ThemeProvider";
import AppFooter from "@/back/Components/Layout/AppFooter";
import ApplicationLogo from "@/back/Components/ApplicationLogo";
import useTrans from "@/hooks/use-translations";
import { AppEnv } from "@/back/types/global";
export default function Default({ status }: { status: number }) {
const { locale } = usePage().props.appEnv as AppEnv;
return (
<ThemeProvider defaultTheme="light" storageKey="vite-ui-theme">
<TooltipProvider>
@ -31,7 +33,7 @@ export default function Default({ status }: { status: number }) {
</Link>
</Button>
<Button variant="outline" asChild>
<a href={route("front.homepage")}>
<a href={route("front.dynamic-pages.accueil." + locale)}>
{useTrans("back.your_website")}
</a>
</Button>

View file

@ -55,6 +55,7 @@ type ActivityLogModel = {
type DynamicPageModel = {
policies: ModelPolicy;
id: number;
id_key: string;
title: TranslationField;
slug: TranslationField;
content: TranslationField<string | boolean | number> | null;
@ -62,6 +63,7 @@ type DynamicPageModel = {
config_id: number;
status: number;
isLocked: boolean;
isRoot: boolean;
created_at: Date;
updated_at: Date;
deleted_at: Date;

View file

@ -41,10 +41,10 @@
<div class="{{ $wrapperClasses }}">
<div class="{{ $containerClasses }}">
<div class="swiper-wrapper">
@foreach ($brands as $b)
@foreach ($brands as $brand)
<div class="swiper-slide">
<a class="brands-list__item" href="{{ isset($b['link']) ? $b['link'] : '' }}"
title="Nos marques"><img src="{{ $b['image']['url'] }}" alt="Nos marques" /></a>
<a class="brands-list__item" href="{{ isset($brand['link']) ? $brand['link'] : '' }}"
title="Nos marques"><img src="{{ $brand['image']['url'] }}" alt="Nos marques" /></a>
</div>
@endforeach
</div>

View file

@ -1,4 +1,4 @@
@if ($breadcrumbs->isNotEmpty() && request()->route()->getName() !== 'front.homepage')
@if ($breadcrumbs->isNotEmpty() && request()->route()->getName() !== 'front.dynamic-pages.accueil.' . app()->getLocale())
<div class="breadcrumbs fw">
<div class="breadcrumbs__wrapper wrapper">
@foreach ($breadcrumbs as $breadcrumb)

View file

@ -0,0 +1,130 @@
@extends('front.layouts.layout')
@section('title', $dynamicPageModel->content['list_seo_fields'][0]['string_seo_title'])
@section('description', $dynamicPageModel->content['list_seo_fields'][0]['textarea_seo_description'])
@section('content')
{{-- VIDEO --}}
@if (isset($dynamicPageModel->content['list_section_presentation']))
@php
$video = [
'show_block' => true,
'title' => $dynamicPageModel->content['list_section_presentation'][0]['string_title'],
'subtitle' => [
'text' => $dynamicPageModel->content['list_section_presentation'][0]['string_subtitle'],
'cursive' => true,
],
'video' => isset($dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video'])
? $dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video']
: $dynamicPageModel->content['list_section_presentation'][0]['vimeoid_video'],
'type_video' => isset($dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video']) ? 'youtube' : 'vimeo',
'texte' => ''
];
@endphp
<x-front.videobloc :video="$video" />
@endif
{{-- ENGAGEMENTS --}}
@if(isset($pageNosEngagements))
@php
$engagements = [
'title' => $pageNosEngagements->title,
'subtitle' => '',
'text' => $dynamicPageModel->content['list_section_our_commitments'][0]['wysiwyg_content'],
'button' => [
'title' => $pageNosEngagements->title,
'url' => \App\Helpers\RouteHelper::routeNameChecker("front.dynamic-pages.$pageNosEngagements->id_key"),
'target' => '',
],
];
@endphp
<x-front.commitments.wrapper :engagements="$engagements" />
@endif
{{-- KEY FIGURES --}}
@if(isset($pageNousConnaitre))
<x-front.key-figures :keyFigures="$pageNousConnaitre->content['list_section_key_figures'][0]" />
@endif
{{-- VALUES --}}
@if(isset($pageNousConnaitre))
<x-front.values :title="$pageNousConnaitre->content['list_section_our_values'][0]['string_title']"
:list="$pageNousConnaitre->content['list_section_our_values'][0]['list_values']" />
@endif
{{-- TEXT BLOCK --}}
@php
$blocks = [
'hide_block' => false,
'title' => $dynamicPageModel->content['list_section_together'][0]['string_title'],
'subtitle' => [
'text' => $dynamicPageModel->content['list_section_together'][0]['string_subtitle'],
'cursive' => true,
],
'bg' => true,
'list' => [],
];
foreach($dynamicPageModel->content['list_section_together'][0]['list_content_block'] as $keyContent => $content) {
$positionMedium = intval($content['list_medium'][0]['position_medium']);
array_push($blocks['list'], [
'title' => $content['string_title'] ?? null,
'text' => $content['wysiwyg_description'],
'quote' => 0,
'swap_position' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value()
? true
: $positionMedium === \App\Enums\ElementPositionEnum::showright->value(),
'in_row' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value(),
'floated' => 0,
'align_center' => 1,
'borders_desktop' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'borders_mobile' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'image' => [
[
'url' => $content['list_medium'][0]['image_picture'],
'alt' => $content['list_medium'][0]['string_alt'],
],
],
'button' => [
'title' => $content['list_button'][0]['string_label'],
'url' => $content['list_button'][0]['url_link'],
'target' => '_blank',
],
'button_icon' => 'btn__icon_arrow-right',
]);
}
@endphp
<x-front.text-block :textBlock="$blocks" />
{{-- BRANDS --}}
@php
$brands = [];
if (
isset($pageNosMarques)
&& isset($pageNosMarques->content['list_our_big_brands'])
&& isset($pageNosMarques->content['list_our_big_brands'][0]['list_brands'])
) {
foreach ($pageNosMarques->content['list_our_big_brands'][0]['list_brands'] as $key => $logo) {
array_push($brands, [
'image' => [
'url' => asset($logo['list_logo'][0]['image_brand_logo']),
],
'link' => \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.nos-marques'),
]);
}
}
@endphp
@if(isset($pageNosMarques) && !empty($brands))
<x-front.brands-icons.brands-icons :brands="$brands" :title="$pageNosMarques->title" />
@endif
@endsection

View file

@ -6,7 +6,7 @@
@section('content')
<h1>{{ sprintf("%s - %s", $status, trans("errors.$status.title")) }}</h1>
<p>{{ trans("errors.$status.description") }}</p>
<a href="{{ route('front.homepage') }}">
Revenir à la page d'accueil
<a href="{{ \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.accueil') }}">
{{ trans("front.back_to_homepage") }}
</a>
@endsection

View file

@ -1,674 +0,0 @@
@extends('front.layouts.layout')
@section('title', 'Accueil - LDC Le Groupe LDC, groupe agroalimentaire responsable')
@section('description', 'LDC, un groupe responsable parmi les leaders européens de la volaille et du traiteur,
ancré dans les territoires et reconnu pour la qualité de ses produits.')
@section('content')
@php
global $mob;
$mob = false;
$hero = [
[
'title' => 'BIENVENUE CHEZ LDC',
'subtitle' => 'LDC, un Groupe familial parmi les leaders européens de la volaille et du traiteur',
'text' => '',
'button' => '',
'video_?' => true,
'video_file' => '/assets/uploads/2023/06/Publicité-marque-LDC.mp4',
'image' => '/assets/uploads/2020/02/homepage_hero.jpg',
'image_borders' => [
'desktop' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
], 'mobile' => [
'left' => false,
'right' => false,
'top' => false,
'bottom' => true,
],
],
],
];
@endphp
<x-front.hero :hero="$hero" />
<?php
// FIXME: Pas de données en PROD, on garde ou ça dégage ?
// $add_block = get_field('additional_video_text');
// if (!empty($add_block) && $add_block['text_block'] !== NULL) {
// set_query_var('text_block', $add_block['text_block']);
// set_query_var('addclass', 'no-bottom-padding');
// get_template_part('partials/text-block');
// }
?>
{{-- VIDEO --}}
@php
$video = [
'show_block' => true,
'title' => 'Présentation',
'subtitle' => [
'text' => 'Du Groupe LDC',
'cursive' => true,
],
'video' => 't6w2stRvDH8',
'type_video' => 'youtube',
'texte' => ''
];
@endphp
<x-front.videobloc :video="$video" />
{{-- ENGAGEMENTS --}}
@php
$engagements = [
'title' => 'Nos engagements',
'subtitle' => '', 'text' => 'Ancré dans les territoires, soucieux de préserver les filières locales et de
valoriser l’origine nationale, LDC s’organise pour répondre avec pragmatisme aux enjeux de demain via 4 engagements
prioritaires : Élever Durablement, Mieux Vivre Ensemble, Respecter la Terre, Bien Nourrir.',
'button' => [
'title' => 'Nos engagements',
'url' => \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.nos-engagements'),
'target' => '',
],
];
@endphp
<x-front.commitments.wrapper :engagements="$engagements" />
{{-- KEY FIGURES --}}
<x-front.key-figures :keyFigures="[]" />
{{-- VALUES --}}
<x-front.values title="" :list="[]" />
{{-- TEXT BLOCK --}}
@php
$text_block = [
'hide_block' => false,
'title' => 'Ensemble',
'subtitle' => [
'text' => 'Cultivons notre avenir',
'cursive' => true,
],
'bg' => true,
'list' => [
[
'swap_position' => true,
'in_row' => false,
'floated' => false,
'align_center' => false,
'quote' => false,
'quote_author' => '',
'title' => 'Vous souhaitez exercer vos talents ? Rejoignez-nous !',
'text' => 'Vous avez le goût de l’initiative et souhaitez intégrer une entreprise qui vous
fasse confiance ?
Vous recherchez une entreprise conviviale, engagée et innovante qui vous encourage à exprimer vos
idées et à partager ce qui vous anime ?
Rejoignez-nous !',
'button' => [
'title' => 'Nous rejoindre',
'url' => 'https://recrutement.ldc.fr/fr/annonces',
'target' => '_blank',
],
'button_icon' => 'btn__icon_arrow-right',
'image' => [
[
'ID' => 14287,
'id' => 14287,
'title' => 'REJOIGNEZ-NOUS_2025',
'filename' => 'REJOIGNEZ-NOUS_2025.jpg',
'filesize' => 0,
'url' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025.jpg',
'link' => '/rejoignez-nous_2025/',
'alt' => 'Rejoignez-nous : nous recrutons !',
'author' => '8',
'description' => 'Rejoignez-nous : nous recrutons !',
'caption' => 'Rejoignez-nous : nous recrutons !',
'name' => 'rejoignez-nous_2025',
'status' => 'inherit',
'uploaded_to' => 0,
'date' => '2025-01-07 14:27:24',
'modified' => '2025-01-07 14:28:13',
'menu_order' => 0,
'mime_type' => 'image/jpeg',
'type' => 'image',
'subtype' => 'jpeg',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 600,
'height' => 400,
'sizes' => [
'thumbnail' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025-150x150.jpg',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025-300x200.jpg',
'medium-width' => 300,
'medium-height' => 200,
'medium_large' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025.jpg',
'medium_large-width' => 600,
'medium_large-height' => 400,
'large' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025.jpg',
'large-width' => 600,
'large-height' => 400,
'1536x1536' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025.jpg',
'1536x1536-width' => 600,
'1536x1536-height' => 400,
'2048x2048' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025.jpg',
'2048x2048-width' => 600,
'2048x2048-height' => 400,
'post-thumbnail' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025-360x240.jpg',
'post-thumbnail-width' => 360,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2025/01/REJOIGNEZ-NOUS_2025-150x150.jpg',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
],
'image_description' => '',
'video' => NULL,
'borders_desktop' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'borders_mobile' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
],
[
'swap_position' => false,
'in_row' => false,
'floated' => false,
'align_center' => false,
'quote' => false,
'quote_author' => '',
'title' => 'Éleveurs, rejoignez-nous !',
'text' => 'Nos éleveurs sont des femmes et des hommes responsables et passionnés par leur travail et
leurs animaux, avec lesquels le Groupe LDC entretient une relation de confiance depuis près de 50 ans.
Nos éleveurs respectent les différents cahiers des charges et leurs engagements (respect des animaux
et de l’environnement, transparence, contrôles par des organismes tiers…], et le Groupe protège leur
revenu via la contractualisation (fixation des prix, sécurisation des approvisionnements et débouchés)
et l’accompagnement technique (conseil par des spécialistes de l’élevage, formations, audits qualité…).
Pour développer durablement l’élevage, le Groupe s’appuie historiquement sur les démarches sous signes
officiels de qualité (Label Rouge, Appellation d’origine contrôlée, Agriculture Biologique) pour les
volailles élevées en plein-air, sur la Certification Conformité Produit, et depuis 2017 sur notre
démarche éthique « Nature d’Eleveurs » pour les volailles certifiées et les volailles du quotidien.',
'button' => [
'title' => 'Nous rejoindre en tant qu\'éleveur',
'url' => 'https://www.ldc.fr/nous-contacter/nous-rejoindre-en-tant-queleveur/',
'target' => '_blank',
],
'button_icon' => 'btn__icon_arrow-right',
'image' => [
[
'ID' => 6779,
'id' => 6779,
'title' => 'ELEVEURS-REJOIGNEZ-NOUS2',
'filename' => 'ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'filesize' => 0,
'url' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'link' => '/accueil/eleveurs-rejoignez-nous2/',
'alt' => 'Une éleveuse et sa volaille dans son jardin.',
'author' => '8',
'description' => 'Une éleveuse et sa volaille dans son jardin.',
'caption' => 'ELEVEURS-REJOIGNEZ-NOUS2',
'name' => 'eleveurs-rejoignez-nous2',
'status' => 'inherit',
'uploaded_to' => 339,
'date' => '2020-10-21 13:04:12',
'modified' => '2020-10-21 13:05:07',
'menu_order' => 0,
'mime_type' => 'image/jpeg',
'type' => 'image',
'subtype' => 'jpeg',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 500,
'height' => 281,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2-150x150.jpg',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2-300x169.jpg',
'medium-width' => 300,
'medium-height' => 169,
'medium_large' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'medium_large-width' => 500,
'medium_large-height' => 281,
'large' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'large-width' => 500,
'large-height' => 281,
'1536x1536' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'1536x1536-width' => 500,
'1536x1536-height' => 281,
'2048x2048' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2.jpg',
'2048x2048-width' => 500,
'2048x2048-height' => 281,
'post-thumbnail' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2-412x232.jpg',
'post-thumbnail-width' => 412,
'post-thumbnail-height' => 232,
'alm-thumbnail' => '/assets/uploads/2020/10/ELEVEURS-REJOIGNEZ-NOUS2-150x150.jpg',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
],
'image_description' => '',
'video' => NULL,
'borders_desktop' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'borders_mobile' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
],
],
];
@endphp
<x-front.text-block :textBlock="$text_block" />
{{-- BRANDS --}}
@php
$brands = [
[
'image' => [
'ID' => 10154,
'id' => 10154,
'title' => 'Lg-site-web-ldc-255x255',
'filename' => 'Lg-site-web-ldc-255x255-1.png',
'filesize' => 0,
'url' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'link' => '/lg-site-web-ldc-255x255/',
'alt' => '',
'author' => '8',
'description' => '',
'caption' => '',
'name' => 'lg-site-web-ldc-255x255',
'status' => 'inherit',
'uploaded_to' => 0,
'date' => '2021-05-10 12:27:55',
'modified' => '2021-05-10 12:27:55',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2021/05/Lg-site-web-ldc-255x255-1-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_1_1',
],
[
'image' => [
'ID' => 5507,
'id' => 5507,
'title' => 'LOUE-2020',
'filename' => 'LOUE-2020.png',
'filesize' => 0,
'url' => '/assets/uploads/2020/06/LOUE-2020.png',
'link' => '/loue-2020/',
'alt' => '',
'author' => '7',
'description' => '',
'caption' => '',
'name' => 'loue-2020',
'status' => 'inherit',
'uploaded_to' => 0,
'date' => '2020-06-25 12:15:31',
'modified' => '2020-06-25 12:15:31',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/06/LOUE-2020-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/06/LOUE-2020.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2020/06/LOUE-2020.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2020/06/LOUE-2020.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2020/06/LOUE-2020.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2020/06/LOUE-2020.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2020/06/LOUE-2020-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2020/06/LOUE-2020-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_1_2',
],
[
'image' => [
'ID' => 505,
'id' => 505,
'title' => 'brand-3',
'filename' => 'brand-3-2.png',
'filesize' => 0,
'url' => '/assets/uploads/2020/02/brand-3-2.png',
'link' => '/nos-marques/brand-3-3/',
'alt' => '',
'author' => '20',
'description' => '',
'caption' => '',
'name' => 'brand-3-3',
'status' => 'inherit',
'uploaded_to' => 175,
'date' => '2020-02-20 11:55:52',
'modified' => '2020-02-20 11:55:52',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/02/brand-3-2-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/02/brand-3-2.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2020/02/brand-3-2.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2020/02/brand-3-2.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2020/02/brand-3-2.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2020/02/brand-3-2.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2020/02/brand-3-2-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2020/02/brand-3-2-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_1_3',
],
[
'image' => [
'ID' => 506,
'id' => 506,
'title' => 'brand-4',
'filename' => 'brand-4-2.png',
'filesize' => 0,
'url' => '/assets/uploads/2020/02/brand-4-2.png',
'link' => '/nos-marques/brand-4-3/',
'alt' => '',
'author' => '20',
'description' => '',
'caption' => '',
'name' => 'brand-4-3',
'status' => 'inherit',
'uploaded_to' => 175,
'date' => '2020-02-20 11:55:52',
'modified' => '2020-02-20 11:55:52',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/02/brand-4-2-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/02/brand-4-2.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2020/02/brand-4-2.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2020/02/brand-4-2.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2020/02/brand-4-2.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2020/02/brand-4-2.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2020/02/brand-4-2-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2020/02/brand-4-2-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_1_4',
],
[
'image' => [
'ID' => 5503,
'id' => 5503,
'title' => 'MAITRE_COQ_255x255',
'filename' => 'MAITRE_COQ_255x255.png',
'filesize' => 0,
'url' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'link' => '/type/arrive-plateforme-logistique-les-essarts/maitre_coq_255x255/',
'alt' => '',
'author' => '7',
'description' => '',
'caption' => '',
'name' => 'maitre_coq_255x255',
'status' => 'inherit',
'uploaded_to' => 1373,
'date' => '2020-06-25 12:15:30',
'modified' => '2021-03-04 13:36:10',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/06/MAITRE_COQ_255x255-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2020/06/MAITRE_COQ_255x255.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2020/06/MAITRE_COQ_255x255-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2020/06/MAITRE_COQ_255x255-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_1_5',
],
[
'image' => [
'ID' => 508,
'id' => 508,
'title' => 'brand-6',
'filename' => 'brand-6-2.png',
'filesize' => 0,
'url' => '/assets/uploads/2020/02/brand-6-2.png',
'link' => '/nos-marques/brand-6-3/',
'alt' => '',
'author' => '20',
'description' => '',
'caption' => '',
'name' => 'brand-6-3',
'status' => 'inherit',
'uploaded_to' => 175,
'date' => '2020-02-20 11:55:53',
'modified' => '2020-02-20 11:55:53',
'menu_order' => 0,
'mime_type' => 'image/png',
'type' => 'image',
'subtype' => 'png',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2020/02/brand-6-2-150x150.png',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2020/02/brand-6-2.png',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2020/02/brand-6-2.png',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2020/02/brand-6-2.png',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2020/02/brand-6-2.png',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2020/02/brand-6-2.png',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2020/02/brand-6-2-240x240.png',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2020/02/brand-6-2-150x150.png',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '/nos-marques/#brand_2_1',
],
[
'image' => [
'ID' => 12529,
'id' => 12529,
'title' => 'logo-matines-255x255',
'filename' => 'logo-matines-255x255-1.gif',
'filesize' => 0,
'url' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'link' => '/logo-matines-255x255/',
'alt' => 'Logo de la marque Matines',
'author' => '8',
'description' => 'Logo de la marque Matines',
'caption' => 'Logo de la marque Matines',
'name' => 'logo-matines-255x255',
'status' => 'inherit',
'uploaded_to' => 0,
'date' => '2023-04-28 12:15:44',
'modified' => '2023-04-28 12:15:59',
'menu_order' => 0,
'mime_type' => 'image/gif',
'type' => 'image',
'subtype' => 'gif',
'icon' => '/wp/wp-includes/images/media/default.png',
'width' => 255,
'height' => 255,
'sizes' => [
'thumbnail' => '/assets/uploads/2023/04/logo-matines-255x255-1-150x150.gif',
'thumbnail-width' => 150,
'thumbnail-height' => 150,
'medium' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'medium-width' => 255,
'medium-height' => 255,
'medium_large' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'medium_large-width' => 255,
'medium_large-height' => 255,
'large' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'large-width' => 255,
'large-height' => 255,
'1536x1536' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'1536x1536-width' => 255,
'1536x1536-height' => 255,
'2048x2048' => '/assets/uploads/2023/04/logo-matines-255x255-1.gif',
'2048x2048-width' => 255,
'2048x2048-height' => 255,
'post-thumbnail' => '/assets/uploads/2023/04/logo-matines-255x255-1-240x240.gif',
'post-thumbnail-width' => 240,
'post-thumbnail-height' => 240,
'alm-thumbnail' => '/assets/uploads/2023/04/logo-matines-255x255-1-150x150.gif',
'alm-thumbnail-width' => 150,
'alm-thumbnail-height' => 150,
],
],
'link' => '',
],
];
$includeBladeName = $mob ? 'front.brands-icons.brands-icons-mobile' : 'front.brands-icons.brands-icons';
@endphp
<x-dynamic-component :component="$includeBladeName" :brands="$brands" title="Nos marques" />
@endsection

View file

@ -106,6 +106,7 @@
'image' => [
'url' => asset($logo['list_logo'][0]['image_brand_logo']),
],
'link' => \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.nos-marques'),
]);
}
}

View file

@ -10,26 +10,34 @@ use Diglactic\Breadcrumbs\Generator;
use Illuminate\Support\Str;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
$currentLocale = app()->getLocale();
$supportedLocales = LaravelLocalization::getSupportedLanguagesKeys();
// * HOMEPAGE.
Breadcrumbs::for('front.homepage', function (Generator $trail) {
$trail->push(
Str::ucfirst(trans('front.homepage')),
route('front.homepage')
);
});
$pageHome = DynamicPage::getModelsCached()
->where('status', PageStatusEnum::published)
->where('id_key', 'accueil')
->first();
if ($pageHome && !request()->routeIs("front.dynamic-pages.accueil.$currentLocale")) {
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.accueil.$locale", function (Generator $trail) use ($pageHome) {
$trail->push($pageHome->title, RouteHelper::routeNameChecker('front.dynamic-pages.accueil'));
});
}
}
// * CONTACT PAGE
Breadcrumbs::for('front.contact.index', function (Generator $trail) {
$trail->parent('front.homepage');
Breadcrumbs::for('front.contact.index', function (Generator $trail) use ($pageHome, $currentLocale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$currentLocale");
}
$trail->push(
Str::of(trans('front.contact.index'))->ucfirst(),
route('front.contact.index')
);
});
// * CONTACT PAGE
Breadcrumbs::for('front.contact.show', function (Generator $trail) {
$trail->parent('front.contact.index');
$slug = \request()->route()->parameters['slug'];
@ -45,8 +53,10 @@ Breadcrumbs::for('front.contact.show', function (Generator $trail) {
});
// * SEARCH PAGE
Breadcrumbs::for('front.search', function (Generator $trail) {
$trail->parent('front.homepage');
Breadcrumbs::for('front.search', function (Generator $trail) use ($pageHome, $currentLocale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$currentLocale");
}
$trail->push(
Str::of(trans('front.search'))->ucfirst(),
route('front.search')
@ -59,14 +69,15 @@ $pageEspacePresse = DynamicPage::getModelsCached()
->where('id_key', 'espace-presse')
->first();
if ($pageEspacePresse) {
Breadcrumbs::for('front.dynamic-pages.espace-presse.fr', function (Generator $trail) use ($pageEspacePresse) {
$trail->parent('front.homepage');
$trail->push($pageEspacePresse->title);
});
Breadcrumbs::for('front.dynamic-pages.espace-presse.en', function (Generator $trail) use ($pageEspacePresse) {
$trail->parent('front.homepage');
$trail->push($pageEspacePresse->title);
});
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.espace-presse.$locale", function (Generator $trail) use ($pageEspacePresse, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->parent("front.dynamic-pages.accueil");
$trail->push($pageEspacePresse->title);
});
}
}
// * ENGAGEMENTS PAGES.
@ -76,8 +87,10 @@ $pageOurCommitments = DynamicPage::getModelsCached()
->first();
if ($pageOurCommitments) {
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.nos-engagements.$locale", function (Generator $trail) use ($pageOurCommitments) {
$trail->parent('front.homepage');
Breadcrumbs::for("front.dynamic-pages.nos-engagements.$locale", function (Generator $trail) use ($pageOurCommitments, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->push($pageOurCommitments->title, RouteHelper::routeNameChecker('front.dynamic-pages.nos-engagements'));
});
foreach ($pageOurCommitments->childPages as $key => $childPage) {
@ -96,8 +109,10 @@ $pageKnowUs = DynamicPage::getModelsCached()
->first();
if ($pageKnowUs) {
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.nous-connaitre.$locale", function (Generator $trail) use ($pageKnowUs) {
$trail->parent('front.homepage');
Breadcrumbs::for("front.dynamic-pages.nous-connaitre.$locale", function (Generator $trail) use ($pageKnowUs, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->push($pageKnowUs->title);
});
}
@ -109,14 +124,14 @@ $pageNosMarques = DynamicPage::getModelsCached()
->where('id_key', 'nos-marques')
->first();
if ($pageNosMarques) {
Breadcrumbs::for('front.dynamic-pages.nos-marques.fr', function (Generator $trail) use ($pageNosMarques) {
$trail->parent('front.homepage');
$trail->push($pageNosMarques->title);
});
Breadcrumbs::for('front.dynamic-pages.nos-marques.en', function (Generator $trail) use ($pageNosMarques) {
$trail->parent('front.homepage');
$trail->push($pageNosMarques->title);
});
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.nos-marques.$locale", function (Generator $trail) use ($pageNosMarques, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->push($pageNosMarques->title);
});
}
}
// * JOIN US.
@ -125,14 +140,14 @@ $pageNousRejoindre = DynamicPage::getModelsCached()
->where('id_key', 'nous-rejoindre')
->first();
if ($pageNousRejoindre) {
Breadcrumbs::for('front.dynamic-pages.nous-rejoindre.fr', function (Generator $trail) use ($pageNousRejoindre) {
$trail->parent('front.homepage');
$trail->push($pageNousRejoindre->title);
});
Breadcrumbs::for('front.dynamic-pages.nous-rejoindre.en', function (Generator $trail) use ($pageNousRejoindre) {
$trail->parent('front.homepage');
$trail->push($pageNousRejoindre->title);
});
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.nous-rejoindre.$locale", function (Generator $trail) use ($pageNousRejoindre, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->push($pageNousRejoindre->title);
});
}
}
// * OUR JOBS.
@ -141,14 +156,14 @@ $pageNosMetiers = DynamicPage::getModelsCached()
->where('id_key', 'nos-metiers')
->first();
if ($pageNosMetiers) {
Breadcrumbs::for('front.dynamic-pages.nos-metiers.fr', function (Generator $trail) use ($pageNosMetiers) {
$trail->parent('front.homepage');
$trail->push($pageNosMetiers->title);
});
Breadcrumbs::for('front.dynamic-pages.nos-metiers.en', function (Generator $trail) use ($pageNosMetiers) {
$trail->parent('front.homepage');
$trail->push($pageNosMetiers->title);
});
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.nos-metiers.$locale", function (Generator $trail) use ($pageNosMetiers, $pageHome, $locale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$locale");
}
$trail->push($pageNosMetiers->title);
});
}
}
// * NEWS.
@ -158,8 +173,10 @@ $pageNews = DynamicPage::getModelsCached()
->first();
if ($pageNews) {
foreach ($supportedLocales as $key => $locale) {
Breadcrumbs::for("front.dynamic-pages.actualites.$locale", function (Generator $trail) use ($pageNews) {
$trail->parent('front.homepage');
Breadcrumbs::for("front.dynamic-pages.actualites.$locale", function (Generator $trail) use ($pageNews, $pageHome, $currentLocale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$currentLocale");
}
$trail->push($pageNews->title, RouteHelper::routeNameChecker('front.dynamic-pages.actualites'));
});
}
@ -174,10 +191,11 @@ if ($pageNews) {
});
}
// * FINANCE.
Breadcrumbs::for('front.finance', function (Generator $trail) {
$trail->parent('front.homepage');
Breadcrumbs::for('front.finance', function (Generator $trail) use ($pageHome, $currentLocale) {
if ($pageHome) {
$trail->parent("front.dynamic-pages.accueil.$currentLocale");
}
$trail->push(
Str::of(trans('front.finance'))->ucfirst(),
route('front.finance')

View file

@ -17,8 +17,6 @@ Route::group(
]
],
function () {
Route::get('/', [HomeController::class, 'homepage'])->name('homepage');
Route::name('contact.')->controller(ContactController::class)->group(function () {
Route::get(LaravelLocalization::transRoute('routes.contact_index'), 'index')->name('index');
Route::get(LaravelLocalization::transRoute('routes.contact'), 'show')->defaults('contactPage', 'contactPage')->name('show');
@ -37,8 +35,6 @@ Route::group(
Route::get(LaravelLocalization::transRoute('routes.news'), [NewsController::class, 'show'])->name('news.show');
Route::get('/politique-de-confidentialite', function () {
$page = [
'seo_title' => 'LDC Charte de confidentialité',