PHPackages                             coreplex/crumbs - 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. coreplex/crumbs

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

coreplex/crumbs
===============

Framework agnostic breadcrumb container

1.0.6(8y ago)31.8k↓100%2MITPHPPHP &gt;=5.4.0

Since Mar 17Pushed 8y ago3 watchersCompare

[ Source](https://github.com/coreplex/crumbs)[ Packagist](https://packagist.org/packages/coreplex/crumbs)[ RSS](/packages/coreplex-crumbs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

Crumbs [![Build Status](https://camo.githubusercontent.com/267178f1a994352c52614787a069d42848d5d764eff5856a62d3d4ff49430205/68747470733a2f2f7472617669732d63692e6f72672f636f7265706c65782f6372756d62732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/coreplex/crumbs) [![Coverage Status](https://camo.githubusercontent.com/9a2e980ab558ceb6c1586254c7a94d95b5f6b967137ae883bae161d821794f55/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f636f7265706c65782f6372756d62732f62616467652e737667)](https://coveralls.io/r/coreplex/crumbs)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#crumbs--)

Framework agnostic breadcrumb container

Installation via composer
-------------------------

[](#installation-via-composer)

The package requires PHP 5.4+, includes a Laravel 5 Service Provider/Facade for quick integration, and abides the FIG standard PSR-4, allowing for a consistent codebase. All Coreplex packages follow these set standards. The repository is also fully unit tested through and continuously integrated through use of [Travis CI](https://travis-ci.org/coreplex/crumbs).

To install Crumbs via composer, simply add it to your composer.json file

```
"require": {
    "coreplex/crumbs": "~1.0"
},
```

Then run `composer update` via the command line. To automatically add this into your composer json, you can simply run `composer require coreplex/crumbs`, and composer will handle this all for you

The Container
-------------

[](#the-container)

All breadcrumbs are held in a **Container** class. This allows you to prepare and render a set of breadcrumbs. A container has two dependencies. A `Contracts\Crumb` instance, and a `Contracts\Renderer` instance. We provide basic ones in the repository to be used

```
$container = new Coreplex\Crumbs\Container(new Coreplex\Crumbs\Components\Crumb, new Coreplex\Crumbs\Renderers\Basic);
```

To add a few breadcrumbs to the container, you can either use the `append` method directly, like so

```
$container->append('Homepage', '/home');
```

Or you can use a closure to group them into their own scope. To do this, just call the `prepare` method and use any of the container functions on the passed instance

```
$container->prepare(function($crumbs)
{
    $crumbs->append('Homepage', '/home')
           ->append('Edit');
});
```

To add a breadcrumb to the start of the container rather than the end, use the alternative `prepend` method

```
$container->prepend('The Website', '/');
```

Rendering The Breadcrumbs
-------------------------

[](#rendering-the-breadcrumbs)

The basic renderer provided will return a simple list-based navigation string. This can be invoked through the main container class by just calling the `render` method.

```
echo $container->render();
```

The render method causes the last breadcrumb to be active by default. To disable this behaviour, pass false as the first parameter when calling render.

```
echo $container->render(false);
```

The container can also be rendered by simply echoing out the class, as it will be implicitly type-cast to a string.

```
echo $container;
```

Retrieving The Breadcrumbs and the Crumb Component
--------------------------------------------------

[](#retrieving-the-breadcrumbs-and-the-crumb-component)

If you are going to be handling breadcrumbs from the container, you will want to access the numerous properties on the class. To do this, you can use the fluent attribute methods

```
$container->append('The Website', '//www.website.com');

foreach ($container->crumbs() as $crumb) {
    var_dump($crumb->label()); // returns 'The Website'
    var_dump($crumb->url()); // returns '//www.website.com'
    var_dump($crumb->current()); // returns true
}
```

There are also respective setters and isSetters for each of the attributes on the class

```
// Append an empty breadcrumb to the container
$container->append();

foreach ($container->crumbs() as $crumb) {
    var_dump($crumb->label()); // returns null

    if ( ! $crumb->hasLabel()) {
        $crumb->setLabel('The Website')
    }

    var_dump($crumb->url()); // returns null

    if ( ! $crumb->hasUrl()) {
        $crumb->setUrl('//www.website.com')
    }

    var_dump($crumb->current()); // returns true

    if ( ! $crumb->current()) {
        $crumb->setCurrent();
    }

    $crumb->setNotCurrent();

    var_dump($crumb->current()); // returns false
}
```

Laravel 5 Support
-----------------

[](#laravel-5-support)

Crumbs has support for Laravel 5 out of the box. Once installed via composer, simply add the service provider to your app.php file

```
'providers' => [

    'Coreplex\Crumbs\CrumbsServiceProvider',

]
```

And also publish the config via command line, using the `php artisan vendor:publish` function. This allows the config to be published to the correct directory

Once these steps have been taken, Crumbs can be dependency injected into any controller constructs like so

```
/**
 * Make a new controller instance
 *
 * @param \Coreplex\Crumbs\Contracts\Container $breadcrumbs
 * @return void
 */
public function __construct(\Coreplex\Crumbs\Contracts\Container $breadcrumbs)
{
    $this->breadcrumbs = $breadcrumbs;
}
```

Which will then allow access to the breadcrumbs container via the breadcrumbs class property on the controller

A facade is also provided to those who would opt using this over dependency injection. Simply add it to the aliases array in app.php

```
'aliases' => [

    'Crumbs' => 'Coreplex\Crumbs\Facades\Crumbs',

],
```

Which would then allow you to do things like this in your controllers

```
use Crumbs;

class DashboardController extends Controller {

    public function index()
    {
        Crumbs::prepare(function($crumbs)
        {
            $crumbs->append('Dashboard Home', route('dashboard.index'));
        });

        return view('dashboard.index')->with('breadcrumbs', Crumbs::render());
    }

}
```

Planned Features
----------------

[](#planned-features)

- Laravel 4 Integration

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~101 days

Recently: every ~228 days

Total

10

Last Release

3157d ago

Major Versions

0.9.2 → 1.02015-03-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c900fbb0718ad3f56b7eb19dd70ebe9588bb471b93494ae799ae2bcc4204d25?d=identicon)[sixteenstudio](/maintainers/sixteenstudio)

![](https://www.gravatar.com/avatar/6ce79ceac70082ad75fd8b498b4fc1e09a60bb577230f14327cb84320ad8a766?d=identicon)[coreplex](/maintainers/coreplex)

---

Top Contributors

[![sixteenstudio](https://avatars.githubusercontent.com/u/4678077?v=4)](https://github.com/sixteenstudio "sixteenstudio (56 commits)")[![CurtisSaunders](https://avatars.githubusercontent.com/u/25106606?v=4)](https://github.com/CurtisSaunders "CurtisSaunders (1 commits)")[![knash94](https://avatars.githubusercontent.com/u/16624721?v=4)](https://github.com/knash94 "knash94 (1 commits)")[![michaeljennings](https://avatars.githubusercontent.com/u/5189701?v=4)](https://github.com/michaeljennings "michaeljennings (1 commits)")[![midnite81](https://avatars.githubusercontent.com/u/254850?v=4)](https://github.com/midnite81 "midnite81 (1 commits)")

---

Tags

laravelbreadcrumbs

### Embed Badge

![Health badge](/badges/coreplex-crumbs/health.svg)

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

###  Alternatives

[robertboes/inertia-breadcrumbs

Laravel package to automatically share breadcrumbs to Inertia

56129.1k](/packages/robertboes-inertia-breadcrumbs)[watson/breadcrumbs

Breadcrumbs made easy for Laravel.

4542.9k](/packages/watson-breadcrumbs)

PHPackages © 2026

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