PHPackages                             jasonstainton/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. jasonstainton/breadcrumbs

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

jasonstainton/breadcrumbs
=========================

Breadcrumb generator for Laravel.

1.0.0(9y ago)2213MITPHPPHP &gt;=5.4.0

Since Apr 19Pushed 9y agoCompare

[ Source](https://github.com/JasonStainton/Breadcrumbs)[ Packagist](https://packagist.org/packages/jasonstainton/breadcrumbs)[ RSS](/packages/jasonstainton-breadcrumbs/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Laravel breadcrumb generator
============================

[](#laravel-breadcrumb-generator)

Easily generate breadcrumbs from a model or view.

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

[](#installation)

Add the following to the `composer.json` file in your project:

```
"jasonstainton/breadcrumbs": "1.*"

```

or you can run the below on the command line in the root of your project:

```
composer require jasonstainton/breadcrumbs "1.*"

```

Add the service provider to the providers array in `config/app.php`.

```
'providers' => [
    // ...
    JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider::class,
],

```

The breadcrumbs directive
-------------------------

[](#the-breadcrumbs-directive)

```
@breadcrumbs()

```

Usually you would add this to a partial that is included wherever you would like your breadcrumbs to display.

Implementation
--------------

[](#implementation)

You can add breadcrumbs dynamically to a model or manually on a view. Each method expects an array to be returned with the crumbs you would like to add. The key should be a fully qualified url *(`http://www.`)* with a string value containing the text you would like to be displayed.

### Via a Model

[](#via-a-model)

Implement the breadcrumb contract on your model.

```
use JasonStainton\Breadcrumbs\Contracts\BreadcrumbContract;

class Model implements BreadcrumbContract
{
	...

```

This will require you to add a `getCrumbs()` method to your model and expects an array to be returned.

```
public function getCrumbs()
{
	return [
		'http://www.example.com/page' => 'Example Crumb',
		route('blog') => 'Blog',
		$this->url => $this->title
	];
}

```

Now all you need to do is pass your model into the breadcrumbs directive.

```
@breadcrumbs($model)

```

### Via a View

[](#via-a-view)

You can manually set breadcrumbs in the directive if you are not using a model. Again an array is all you need to pass in.

```
@breadcrumbs([
	'http://www.example.com/page' => 'Example Crumb',
	route('blog') => 'Blog'
])

```

Configuration
-------------

[](#configuration)

To use a custom template or alter any prepended crumbs run this command line in the root of your project:

```
$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider"

```

To publish just the views or config files you can add the following tags to the command

```
$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider" --tag="config"

$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider" --tag="views"

```

### Custom template

[](#custom-template)

You can easilly edit the breadcrumbs appearance however you like. After publishing the views assets you will find a breadcrumb view that is returned when the breadcrumbs directive is called.

```
/resources/views/vendor/breadcrumbs/breadcrumbs.blade.php

@if(isset($breadcrumbs))

	@foreach($breadcrumbs as $url => $name)

		@if($url == url()->current())

			{{ $name }}

		@else

			{{ $name }} &raquo;

		@endif

	@endforeach

@endif

```

### Prepended crumbs

[](#prepended-crumbs)

By default the breadcrumbs are always returned with a home link crumb. You can remove this to give you the most felxibility when calling breadcrumbs or add to. After publishing the packages config file you can remove the home link or add more to it.

```
/config/breadcrumbs.php

'prepended_breadcrumbs' => [
	'/' => 'Home'
],

```

An array is expected to be returned. So if you want to remove the home crumb just return an empty array.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~10 days

Total

5

Last Release

3318d ago

Major Versions

0.1.3 → 1.0.02017-05-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27767499?v=4)[Jason Stainton](/maintainers/JasonStainton)[@JasonStainton](https://github.com/JasonStainton)

---

Top Contributors

[![JasonStainton](https://avatars.githubusercontent.com/u/27767499?v=4)](https://github.com/JasonStainton "JasonStainton (10 commits)")

---

Tags

laravellaravelmodelbreadcrumbs

### Embed Badge

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

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

###  Alternatives

[robertboes/inertia-breadcrumbs

Laravel package to automatically share breadcrumbs to Inertia

59142.1k1](/packages/robertboes-inertia-breadcrumbs)[gazugafan/laravel-temporal

Temporal models and versioning for Laravel 5

3310.1k](/packages/gazugafan-laravel-temporal)

PHPackages © 2026

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