laravel-breadcrumbs
Advanced Usage
Prepending Breadcrumbs
{note} laravel-breadcrumbs has been archived and is no longer maintained. Use caution when installing in your apps.
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.