ldc-le-gaulois-pro/routes/breadcrumbs-fo.php
Sebastien Hattry 44f2232b61 Add breadcrumb
2023-02-23 08:43:08 +00:00

226 lines
6.6 KiB
PHP

<?php
use App\Models\Advice;
use App\Models\News;
use App\Models\Product;
use App\Models\Range;
use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator;
use Illuminate\Support\Str;
// * Root
Breadcrumbs::for('home', function (Generator $trail) {
$trail->push(Str::ucfirst(trans('Accueil')), route('home'));
});
// * ADN
Breadcrumbs::for('adn.adn', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre ADN')),
route('adn.adn')
);
});
Breadcrumbs::for('adn.story', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre histoire')),
route('adn.story')
);
});
Breadcrumbs::for('adn.btob', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos solutions')),
route('adn.btob')
);
});
Breadcrumbs::for('adn.breeder', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos éleveurs de volailles')),
route('adn.breeder')
);
});
// * ENGAGEMENTS
Breadcrumbs::for('engagments.francais', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos engagements / Marque alimentaire 100% Française')),
route('engagments.francais')
);
});
Breadcrumbs::for('engagments.eleverdurablement', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos engagements / Elever durablement en respectant les Hommes, les animaux et la Nature')),
route('engagments.eleverdurablement')
);
});
Breadcrumbs::for('engagments.biennourrir', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos engagements / Bien nourrir tous les Français')),
route('engagments.biennourrir')
);
});
Breadcrumbs::for('engagments.respecterlaterre', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos engagements / Respecter la Terre')),
route('engagments.respecterlaterre')
);
});
Breadcrumbs::for('engagments.vivreensemble', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos engagements / Favoriser le mieux vivre ensemble')),
route('engagments.vivreensemble')
);
});
// * EXPERTISE
Breadcrumbs::for('expertise.canard', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre expertise volaillère')),
route('expertise.canard')
);
});
Breadcrumbs::for('expertise.dinde', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre expertise volaillère')),
route('expertise.dinde')
);
});
Breadcrumbs::for('expertise.lapin', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre expertise volaillère')),
route('expertise.lapin')
);
});
Breadcrumbs::for('expertise.pintade', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre expertise volaillère')),
route('expertise.pintade')
);
});
Breadcrumbs::for('expertise.poulet', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Notre expertise volaillère')),
route('expertise.poulet')
);
});
// * IDEES
Breadcrumbs::for('ideas.ideas', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Générateur d\'idées, révélateurs de talents')),
route('ideas.ideas')
);
});
Breadcrumbs::for('ideas.tips.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos astuces volaille')),
route('ideas.tips.index')
);
});
Breadcrumbs::for('tips.show', function (Generator $trail, Advice $tip) {
$trail->parent('ideas.tips.index');
$trail->push(
Str::ucfirst($tip->title),
route('tips.show', ['publishedAdvice' => $tip])
);
});
Breadcrumbs::for('ideas.recipes.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos recettes')),
route('ideas.recipes.index')
);
});
Breadcrumbs::for('recipes.show', function (Generator $trail, Advice $recipe) {
$trail->parent('ideas.recipes.index');
$trail->push(
Str::ucfirst($recipe->title),
route('recipes.show', ['publishedAdvice' => $recipe])
);
});
// * PRODUITS
Breadcrumbs::for('products.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos solutions produits')),
route('products.index')
);
});
Breadcrumbs::for('products.range-products', function (Generator $trail, Range $range) {
$trail->parent('products.index');
$trail->push(Str::ucfirst($range->label), route('products.range-products', ['range' => $range]));
});
Breadcrumbs::for('products.show', function (Generator $trail, Product $product) {
$trail->parent('products.index');
$trail->push(
Str::ucfirst($product->subrange->range->label),
route('products.range-products', ['range' => $product->subrange->range])
);
$trail->push(Str::ucfirst($product->label), route('products.show', ['publishedProduct' => $product]));
});
// * ACTUALITE
Breadcrumbs::for('news.index', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Nos actualités')),
route('news.index')
);
});
Breadcrumbs::for('news.show', function (Generator $trail, News $news) {
$trail->parent('news.index');
$trail->push(
Str::ucfirst($news->slug),
route('news.show', ['actu' => $news])
);
});
// * CONTACT
Breadcrumbs::for('contact.show', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Contact')),
route('contact.show')
);
});
// * RECHERCHE
Breadcrumbs::for('search', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Résultats de recherche')),
route('search')
);
});
// * FOOTER
Breadcrumbs::for('policies', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Politique des données personnelles')),
route('policies')
);
});
Breadcrumbs::for('legals', function (Generator $trail) {
$trail->parent('home');
$trail->push(
Str::ucfirst(trans('Mentions légales')),
route('legals')
);
});