Advanced Usage


{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

The Breadcrumbs instance is macroable, so you can add your own methods. For example:

use Rawilk\Breadcrumbs\Facades\Breadcrumbs;

Breadcrumbs::macro('pageTitle', function () {
    $title = ($breadcrumb = $this->current()) ? "{$breadcrumb->title} - " : '';

    if (($page = (int) request('page')) > 1) {
        $title .= "Page {$page} - ";

    return $title . 'Acme';
<title>{!! Breadcrumbs::pageTitle() !!}</title>
Dependency Injection
Caught a mistake? Suggest an edit on GitHub