Advanced Usage

Prepending Breadcrumbs

{note} You're browsing the documentation for an old version of laravel-breadcrumbs. Consider upgrading your project to v4. Check your version with the following command:

composer show rawilk/laravel-breadcrumbs

You can register a "before" callback to add breadcrumbs at the start of the trail. For example, to automatically add the "home" page to the beginning.

Breadcrumbs::before(fn (Generator $trail) => $trail->push('Home', route('home')));

If you are going to prepend a breadcrumb onto every page, a good place to put the breadcrumb definition would be in a boot() method in a service provider.

Route-Bound Breadcrumbs
Caught a mistake? Suggest an edit on GitHub