A PHP package mainly developed for Laravel to generate breadcrumbs using routes.
(This is for Laravel 4.2. For Laravel 5+)
Add this package name in composer.json
"require": {
"sukohi/bakery": "2.*"
}
Execute composer command.
composer update
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\Bakery\BakeryServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'Bakery' => Sukohi\Bakery\Facades\Bakery::class
]
$params = [
'home' => 'Home',
'home.area:vancouver' => 'Vancouver',
'home.food:sushi,popular' => 'Popular sushi restaurants',
'*' => 'Samurai'
];
foreach(\Bakery::get($params) as $bakery) {
if($bakery->isCurrent) {
echo $bakery->title;
} else {
echo link_to($bakery->url, $bakery->title) .' > ';
}
}
- 'route' => 'title'
- 'route:parameter' => 'title'
- 'route:parameter1,parameter2' => 'title',
- '*' => 'Current Page'
This package is licensed under the MIT License.
Copyright 2014 Sukohi Kuhoh