Simple breadcrumbs service for Laravel.
drahosistvan/laravel-breadcrumbs is a Laravel package for simple breadcrumbs service for laravel..
It currently has 0 GitHub stars and 238 downloads on Packagist (latest version v1.0.0).
Install it with composer require drahosistvan/laravel-breadcrumbs.
Discover more Laravel packages by drahosistvan
or browse all Laravel packages to compare alternatives.
Last updated
"drahosistvan/laravel-breadcrumbs": "dev-master"
Run composer update command, to install the package.
Publish the configuration file with php artisan vendor:publish command
In your controller, you can add elements to the Breadcrumbs:
//With facade
Breadcrumbs::add('My page', '/page/xy');
//Adding multiple elements to Breadcrumbs
Breadcrumbs::add('My page', '/page/xy')->add('My page', '/page/xy');
If you want a more cleaner way, you can add $breadcrumbs to your base Controller
protected $breadcrumb;
public function __construct() {
$this->breadcrumb = app('Breadcrumbs');
}
After this, you can add elements like this: $this->breadcrumbs->add()->add() ...
$breadcrumbs variable is available from the view.
Little trick:
If you call $breadcrumbs->last()->title, it will give you the current page's title :)