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

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

saucebase/breadcrumbs
=====================

Minimal breadcrumbs package for Saucebase — a fork of diglactic/laravel-breadcrumbs without Blade rendering.

v1.0.0(1mo ago)030↑1700%1MITPHPPHP ^8.2CI passing

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/saucebase-dev/breadcrumbs)[ Packagist](https://packagist.org/packages/saucebase/breadcrumbs)[ RSS](/packages/saucebase-breadcrumbs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

saucebase/breadcrumbs
=====================

[](#saucebasebreadcrumbs)

Breadcrumb definitions for Laravel applications that serve breadcrumbs as data, not HTML.

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

[](#installation)

```
composer require saucebase/breadcrumbs
```

Defining breadcrumbs
--------------------

[](#defining-breadcrumbs)

Create `routes/breadcrumbs.php` and define breadcrumbs by route name:

```
use Saucebase\Breadcrumbs\Breadcrumbs;
use Saucebase\Breadcrumbs\Generator as Trail;

Breadcrumbs::for('home', function (Trail $trail) {
    $trail->push('Home', route('home'));
});

Breadcrumbs::for('dashboard', function (Trail $trail) {
    $trail->parent('home');
    $trail->push('Dashboard', route('dashboard'));
});

// Route model binding
Breadcrumbs::for('post.show', function (Trail $trail, Post $post) {
    $trail->parent('dashboard');
    $trail->push($post->title, route('post.show', $post));
});
```

Each `push()` call accepts an optional third argument — an array of arbitrary attributes passed through to the breadcrumb item:

```
$trail->push('Label', $url, ['icon' => 'home']);
```

### Generating breadcrumbs

[](#generating-breadcrumbs)

```
// Check if a breadcrumb exists for the current route
Breadcrumbs::exists('dashboard');

// Generate for the current route (reads from request)
$items = Breadcrumbs::current();

// Generate for a named route with parameters
$items = Breadcrumbs::generate('post.show', $post);
```

Each item in the returned collection has `title`, `url`, and `attributes` properties.

Hooks
-----

[](#hooks)

Use `before()` and `after()` to prepend or append items globally across all breadcrumb chains:

```
// Prepend an item to every breadcrumb trail
Breadcrumbs::before(function (Trail $trail) {
    $trail->push('Home', route('home'));
});

// Append an item to every breadcrumb trail
Breadcrumbs::after(function (Trail $trail) {
    $trail->push('Help', route('help'));
});
```

Config
------

[](#config)

Publish the config file with:

```
php artisan vendor:publish --tag=breadcrumbs-config
```

KeyDefaultDescription`files``base_path('routes/breadcrumbs.php')`File(s) where breadcrumbs are defined`unnamed-route-exception``true`Throw `UnnamedRouteException` when the current route has no name`missing-route-bound-breadcrumb-exception``true`Throw `InvalidBreadcrumbException` when no breadcrumb is registered for the current route`invalid-named-breadcrumb-exception``true`Throw `InvalidBreadcrumbException` when calling `generate()` with an unregistered nameTesting
-------

[](#testing)

Override the current route in tests without making real HTTP requests:

```
use Saucebase\Breadcrumbs\Breadcrumbs;

// Set the route that Breadcrumbs::current() will resolve against
Breadcrumbs::setCurrentRoute('post.show', $post);

$items = Breadcrumbs::current();

// Reset after the test
Breadcrumbs::clearCurrentRoute();
```

Exceptions
----------

[](#exceptions)

ExceptionThrown when`UnnamedRouteException`The current route has no name and `unnamed-route-exception` is `true``InvalidBreadcrumbException`A breadcrumb name is not registered and the relevant config exception is `true``DuplicateBreadcrumbException``Breadcrumbs::for()` is called with a name that is already registered---

This package is a fork of [`diglactic/laravel-breadcrumbs`](https://github.com/diglactic/laravel-breadcrumbs) with Blade rendering removed. The `render()` / `view()` methods, the `manager-class` / `generator-class` config options, and the `facade/ignition-contracts` dependency have been stripped. Everything else is preserved.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b984fc5c4f372285b03b0926ca33af6d9d56fba171efaeb674ec120a82650efc?d=identicon)[saucebase](/maintainers/saucebase)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![roble](https://avatars.githubusercontent.com/u/3231587?v=4)](https://github.com/roble "roble (1 commits)")

---

Tags

laravelbreadcrumbssaucebase

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[robertboes/inertia-breadcrumbs

Laravel package to automatically share breadcrumbs to Inertia

56129.1k](/packages/robertboes-inertia-breadcrumbs)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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