153 lines
4.3 KiB
PHP
153 lines
4.3 KiB
PHP
<?php
|
|
|
|
use App\Enums\Contact\ContactFormType;
|
|
use App\Models\News;
|
|
use Diglactic\Breadcrumbs\Breadcrumbs;
|
|
use Diglactic\Breadcrumbs\Generator;
|
|
use Illuminate\Support\Str;
|
|
|
|
// * HOMEPAGE.
|
|
Breadcrumbs::for('front.homepage', function (Generator $trail) {
|
|
$trail->push(
|
|
Str::ucfirst(trans('front.homepage')),
|
|
route('front.homepage')
|
|
);
|
|
});
|
|
|
|
|
|
// * CONTACT PAGE
|
|
Breadcrumbs::for('front.contact.index', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.contact.index'))->ucfirst(),
|
|
route('front.contact.index')
|
|
);
|
|
});
|
|
|
|
Breadcrumbs::for('front.contact.show', function (Generator $trail) {
|
|
$trail->parent('front.contact.index');
|
|
$slug = \request()->route()->parameters['slug'];
|
|
$enumType = collect(ContactFormType::all())->first(function ($enum) use ($slug) {
|
|
return $enum->slug() === $slug;
|
|
});
|
|
if ($slug) {
|
|
$trail->push(
|
|
Str::of(trans($enumType->label()))->ucfirst()
|
|
);
|
|
}
|
|
});
|
|
|
|
// * SEARCH PAGE
|
|
Breadcrumbs::for('front.search', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.search'))->ucfirst(),
|
|
route('front.search')
|
|
);
|
|
});
|
|
|
|
// * ESPACE PRESSE.
|
|
Breadcrumbs::for('front.espace-presse', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.espace-presse'))->ucfirst(),
|
|
route('front.espace-presse')
|
|
);
|
|
});
|
|
|
|
// * ENGAGEMENTS PAGES.
|
|
Breadcrumbs::for('front.nos-engagements', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.nos-engagements'))->ucfirst()->plural(),
|
|
route('front.nos-engagements')
|
|
);
|
|
});
|
|
Breadcrumbs::for('front.elever-durablement', function (Generator $trail) {
|
|
$trail->parent('front.nos-engagements');
|
|
$trail->push(
|
|
Str::of(trans('front.elever-durablement'))->ucfirst(),
|
|
route('front.elever-durablement')
|
|
);
|
|
});
|
|
Breadcrumbs::for('front.mieux-vivre-ensemble', function (Generator $trail) {
|
|
$trail->parent('front.nos-engagements');
|
|
$trail->push(
|
|
Str::of(trans('front.mieux-vivre-ensemble'))->ucfirst(),
|
|
route('front.mieux-vivre-ensemble')
|
|
);
|
|
});
|
|
Breadcrumbs::for('front.respecter-la-terre', function (Generator $trail) {
|
|
$trail->parent('front.nos-engagements');
|
|
$trail->push(
|
|
Str::of(trans('front.respecter-la-terre'))->ucfirst(),
|
|
route('front.respecter-la-terre')
|
|
);
|
|
});
|
|
Breadcrumbs::for('front.bien-nourrir', function (Generator $trail) {
|
|
$trail->parent('front.nos-engagements');
|
|
$trail->push(
|
|
Str::of(trans('front.bien-nourrir'))->ucfirst(),
|
|
route('front.bien-nourrir')
|
|
);
|
|
});
|
|
|
|
// * KNOW US PAGES.
|
|
Breadcrumbs::for('front.nous-connaitre', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.nous-connaitre'))->ucfirst(),
|
|
route('front.nous-connaitre')
|
|
);
|
|
});
|
|
|
|
// * OUR BRANDS PAGE.
|
|
Breadcrumbs::for('front.nos-marques', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.nos-marques'))->ucfirst(),
|
|
route('front.nos-marques')
|
|
);
|
|
});
|
|
|
|
// * JOIN US.
|
|
Breadcrumbs::for('front.nous-rejoindre', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.nous-rejoindre'))->ucfirst(),
|
|
route('front.nous-rejoindre')
|
|
);
|
|
});
|
|
|
|
// * OUR JOBS.
|
|
Breadcrumbs::for('front.nos-metiers', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.nos-metiers'))->ucfirst(),
|
|
route('front.nos-metiers')
|
|
);
|
|
});
|
|
|
|
// * NEWS.
|
|
Breadcrumbs::for('front.news.index', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.news.index'))->ucfirst(),
|
|
route('front.news.index')
|
|
);
|
|
});
|
|
Breadcrumbs::for('front.news.show', function (Generator $trail) {
|
|
$trail->parent('front.news.index');
|
|
$trail->push(
|
|
Str::of(request()->model->title)->ucfirst()
|
|
);
|
|
});
|
|
|
|
// * FINANCE.
|
|
Breadcrumbs::for('front.finance', function (Generator $trail) {
|
|
$trail->parent('front.homepage');
|
|
$trail->push(
|
|
Str::of(trans('front.finance'))->ucfirst(),
|
|
route('front.finance')
|
|
);
|
|
});
|