PHPackages                             watson/breadcrumbs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. watson/breadcrumbs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

watson/breadcrumbs
==================

Breadcrumbs made easy for Laravel.

1.2.0(5y ago)4542.9k5[2 issues](https://github.com/dwightwatson/breadcrumbs/issues)[2 PRs](https://github.com/dwightwatson/breadcrumbs/pulls)MITPHPPHP ^7.2.5||^8.0

Since Feb 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dwightwatson/breadcrumbs)[ Packagist](https://packagist.org/packages/watson/breadcrumbs)[ RSS](/packages/watson-breadcrumbs/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (11)Used By (0)

Breadcrumbs for Laravel
=======================

[](#breadcrumbs-for-laravel)

Warning: this package is currently incompatible with Laravel 7. I have started a rewrite that would support Laravel 7 but I have no ETA. You'll likely want to consider another breadcrumb package in the meantime.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#warning-this-package-is-currently-incompatible-with-laravel-7-i-have-started-a-rewrite-that-would-support-laravel-7-but-i-have-no-eta-youll-likely-want-to-consider-another-breadcrumb-package-in-the-meantime)

[![Build Status](https://camo.githubusercontent.com/9ecf10e417462999832154780c40c60b8d11b6f05a95fb402e588e09988dd264/68747470733a2f2f7472617669732d63692e6f72672f647769676874776174736f6e2f62726561646372756d62732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dwightwatson/breadcrumbs)[![Total Downloads](https://camo.githubusercontent.com/6af8dd990e83070ca4905fa7f63ddef4690b854451336e1b08f8a3beffb7476e/68747470733a2f2f706f7365722e707567782e6f72672f776174736f6e2f62726561646372756d62732f646f776e6c6f6164732e737667)](https://packagist.org/packages/watson/breadcrumbs)[![License](https://camo.githubusercontent.com/b067d2d51b390b29ec65bc46a901947f3828246ae025a230400770da923b283a/68747470733a2f2f706f7365722e707567782e6f72672f776174736f6e2f62726561646372756d62732f6c6963656e73652e737667)](https://packagist.org/packages/watson/breadcrumbs)

Breadcrumbs is a simple breadcrumb generator for Laravel that tries to hook into the magic to make it easy to get up and running.

Installation
------------

[](#installation)

Require the package through Composer as per usual.

```
$ composer require watson/breadcrumbs
```

Usage
-----

[](#usage)

Create a new file at `routes/breadcrumbs.php` to define your breadcrumbs. By default the package will work with named routes which works with resourceful routing. However, you're also free to define routes by the controller action/pair.

```
Breadcrumbs::for('admin.pages.index', function ($trail) {
    $trail->add('Admin', route('admin.pages.index'));
});

Breadcrumbs::for('admin.users.index', function ($trail) {
    $trail->parent('admin.pages.index');
    $trail->add('Users', route('admin.users.index'));
});

Breadcrumbs::for('admin.users.show', function ($trail, User $user) {
    $trail->parent('admin.users.index');
    $trail->add($user->full_name, route('admin.users.show', $user));
});

Breadcrumbs::for('admin.users.edit', function ($trail, User $user) {
    $trail->parent('admin.users.show', $user);
    $trail->add('Edit', route('admin.users.edit', $user));
});

Breadcrumbs::for('admin.users.roles.index', function ($trail, User $user) {
    $trail->parent('admin.users.show', $user);
    $trail->add('Roles', route('admin.users.roles.index', $user));
});

Breadcrumbs::for('admin.users.roles.show', function ($trail, User $user, Role $role) {
    $trail->parent('admin.users.roles.index', $user, $role);
    $trail->add('Edit', route('admin.users.roles.show', [$user, $role]));
});
```

Note that you can call `parent()` from within a breadcrumb definition which lets you build up the breadcrumb tree. Pass any parameters you need further up through the second parameter.

If you want to use controller/action pairs instead of named routes that's fine too. Use the usual Laravel syntax and the package will correctly map it up for you. Note that if the route is named the package will always looked for a named breadcrumb first.

```
Breadcrumbs::for('PagesController@getIndex', function ($trail) {
    $trail->add('Home', action('PagesController@getIndex'));
});

Breadcrumbs::for('secret.page', function ($trail) {
    $trail->add('Secret page', url('secret'))
});
```

### Rendering the breadcrumbs

[](#rendering-the-breadcrumbs)

In your view file, you simply need to call the `render()` method wherever you want your breadcrumbs to appear. It's that easy. If there are no breadcrumbs for the current route, then nothing will be returned.

```
{{ Breadcrumbs::render() }}
```

You don't need to escape the content of the breadcrumbs, it's already wrapped in an instance of `Illuminate\Support\HtmlString` so Laravel knows just how to use it.

### Multiple breadcrumb files

[](#multiple-breadcrumb-files)

If you find that your breadcrumbs files is starting to get a little bigger you may like to break it out into multiple, smaller files. If that's the case you can simply `require` other breadcrumb files at the top of your default definition file.

```
require 'breadcrumbs.admin.php';
```

### Customising the breadcrumb view

[](#customising-the-breadcrumb-view)

The package ships with a Bootstrap 3 compatible view which you can publish and customise as you need, or override completely with your own view. Simply run the following command to publish the view.

```
$ php artisan vendor:publish --provider="Watson\Breadcrumbs\ServiceProvider" --tag=views
```

This will publish the default `bootstrap3` view to your `resources/views/vendor/breadcrumbs` directory from which you can edit the file to your heart's content. If you want to use your own view instead, run the following command to publish the config file.

```
$ php artisan vendor:publish --provider="Watson\Breadcrumbs\ServiceProvider" --tag=config
```

This will publish `config/breadcrumbs.php` which provides you the option to set your own view file for your breadcrumbs.

Credits
-------

[](#credits)

This package is inspired by the work of [Dave James Miller](https://github.com/davejamesmiller/laravel-breadcrumbs), which I've used for some time. It has been re-written by scratch for my use case with a little more magic and less customisation, plus taking advantage of some newer features in PHP. Many thanks to Dave for his work.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~173 days

Recently: every ~323 days

Total

9

Last Release

1991d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.1

1.0.1PHP &gt;=7.0

1.1.0PHP ^7.2.5

1.2.0PHP ^7.2.5||^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1100408?v=4)[Dwight Watson](/maintainers/dwightwatson)[@dwightwatson](https://github.com/dwightwatson)

---

Top Contributors

[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (25 commits)")[![tortuetorche](https://avatars.githubusercontent.com/u/5038872?v=4)](https://github.com/tortuetorche "tortuetorche (3 commits)")[![dlwatersuk](https://avatars.githubusercontent.com/u/5537143?v=4)](https://github.com/dlwatersuk "dlwatersuk (1 commits)")[![dsazup](https://avatars.githubusercontent.com/u/8631224?v=4)](https://github.com/dsazup "dsazup (1 commits)")

---

Tags

breadcrumbslaravellaravelbreadcrumbs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/watson-breadcrumbs/health.svg)

```
[![Health](https://phpackages.com/badges/watson-breadcrumbs/health.svg)](https://phpackages.com/packages/watson-breadcrumbs)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[livewire/flux

The official UI component library for Livewire.

9475.0M86](/packages/livewire-flux)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[glhd/gretel

270305.7k4](/packages/glhd-gretel)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
