98 lines
2.8 KiB
PHP
98 lines
2.8 KiB
PHP
<?php
|
|
|
|
use App\Models\Product;
|
|
use App\Models\Range;
|
|
use App\Models\Recipe;
|
|
use App\Models\StaticPage;
|
|
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'));
|
|
});
|
|
|
|
// * GAMMES / PRODUITS
|
|
Breadcrumbs::for('ranges.index', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Nos volailles')),
|
|
route('ranges.index')
|
|
);
|
|
});
|
|
Breadcrumbs::for('ranges.products', function (Generator $trail, Range $range) {
|
|
$trail->parent('ranges.index');
|
|
$trail->push(Str::ucfirst($range->name), route('ranges.products', ['publishedRange' => $range]));
|
|
});
|
|
Breadcrumbs::for('products.show', function (Generator $trail, Product $product) {
|
|
$trail->parent('ranges.index');
|
|
$trail->push(
|
|
Str::ucfirst($product->range->name),
|
|
route('ranges.products', ['publishedRange' => $product->range])
|
|
);
|
|
$trail->push(Str::ucfirst($product->name), route('products.show', ['publishedProduct' => $product]));
|
|
});
|
|
|
|
// * RECETTES
|
|
Breadcrumbs::for('recipes.index', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Nos recettes et astuces')),
|
|
route('recipes.index')
|
|
);
|
|
});
|
|
Breadcrumbs::for('recipes.show', function (Generator $trail, Recipe $recipe) {
|
|
$trail->parent('recipes.index');
|
|
$trail->push(Str::ucfirst($recipe->name), route('recipes.show', ['publishedRecipe' => $recipe]));
|
|
});
|
|
|
|
// * ENGAGEMENTS
|
|
Breadcrumbs::for('engagments', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Nos engagements')),
|
|
route('engagments')
|
|
);
|
|
});
|
|
Breadcrumbs::for('local', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Nos engagements')),
|
|
route('local')
|
|
);
|
|
});
|
|
|
|
// * OU NOUS TROUVER
|
|
Breadcrumbs::for('map', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Où nous trouver')),
|
|
route('map')
|
|
);
|
|
});
|
|
|
|
// * CONTACT
|
|
Breadcrumbs::for('contact.show', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Nous contacter')),
|
|
route('contact.show')
|
|
);
|
|
});
|
|
|
|
// * FOOTER
|
|
Breadcrumbs::for('policies', function (Generator $trail, StaticPage $staticPage) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans($staticPage->seo_title)),
|
|
route('policies')
|
|
);
|
|
});
|
|
Breadcrumbs::for('legals', function (Generator $trail) {
|
|
$trail->parent('home');
|
|
$trail->push(
|
|
Str::ucfirst(trans('Mentions légales')),
|
|
route('legals')
|
|
);
|
|
});
|