# Laravel Breadcrumbs builds a trail from named closures in a routes file

> Laravel Breadcrumbs is a PHP package that keeps navigation trails in a single routes/breadcrumbs.php file, where each breadcrumb is a named closure that pushes a title and a URL and points at a parent. It renders through eight built-in templates, from Bootstrap 5 to JSON-LD structured data, and is versioned against a specific range of Laravel releases.

**diglactic/laravel-breadcrumbs** — Laravel Breadcrumbs - A simple Laravel-style way to create breadcrumbs.

- Repository: https://github.com/diglactic/laravel-breadcrumbs
- Website: https://packagist.org/packages/diglactic/laravel-breadcrumbs
- Stars: 976 · Forks: 77
- Language: PHP
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/diglactic-laravel-breadcrumbs

## One file holds the whole hierarchy

The package description is short, that it is a simple Laravel-style way to create breadcrumbs, and the design is visible in the first thing you write. Breadcrumbs are usually defined in a file called routes/breadcrumbs.php, and each one is a named closure registered with the for method. The README explains the reasoning behind the shape. For each breadcrumb you specify a name, the breadcrumb title, and the URL to link it to, and since these are likely to change dynamically, you do this in a closure and pass any variables you need into the closure. That last point is the design decision that matters. A breadcrumb for a category needs the category object, and a closure receives it as an argument at render time, so the definition file does not have to query anything and does not have to know whether the page it belongs to exists yet. The names you give are the handles you later use to render or to link.

## Parent links are what make it a trail

The first breadcrumb in a file is usually the homepage, and it only pushes a title and a URL:

```php
<?php // routes/breadcrumbs.php

use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail;

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

The imports in that snippet are worth a note, because the comments explain that they are optional. Laravel resolves the Breadcrumbs facade automatically without the import, and the Generator import exists so the closure can be typed with BreadcrumbTrail, which is described as nice for IDE syntax, refactoring, type checking and completion. Every later breadcrumb declares its parent with a parent call naming another breadcrumb, and pushes its own title and URL, so the trail is built by reference rather than by repeating the ancestors. A category page, for instance, declares blog as its parent and pushes the category title with the route helper and the category object.

## Nine templates, chosen by one config key

Rendering defaults to a Bootstrap 5 breadcrumb list, and the way to change that is to publish the config file and edit one line. The command that publishes it is:

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

After that you edit config/breadcrumbs.php, where the view key looks like this:

```php
'view' => 'breadcrumbs::bootstrap5',
```

The possible values listed in the README are breadcrumbs::bootstrap5, breadcrumbs::bootstrap4, breadcrumbs::bulma, breadcrumbs::foundation6, breadcrumbs::json-ld, breadcrumbs::materialize, breadcrumbs::tailwind and breadcrumbs::uikit, or the path to a custom view such as partials.breadcrumbs. The json-ld option is the odd one out and the most interesting, because it does not render markup at all, it produces JSON-LD structured data in the format search engines use for breadcrumb trails, and that is a different thing to test than a list of links. The README also notes that you can specify a custom view at runtime, which matters for the case where a section of the site uses a different design system from the rest.

## Rendering takes a name and its parameters

Output happens in the view, one call per page, passing the name of the breadcrumb to use and any additional parameters. In a Blade template that is as short as it gets:

```blade
{{-- resources/views/home.blade.php --}}
{{ Breadcrumbs::render('home') }}

{{-- resources/views/categories/show.blade.php --}}
{{ Breadcrumbs::render('category', $category) }}
```

The second line is the one that shows the whole model in miniature. The page asks for the category breadcrumb by name and passes the same category object that the definition file expects, so the definition stays free of lookups and the view stays free of branching. The output section of the README covers other output options, and there is a separate section on route-bound breadcrumbs, which is a way to link breadcrumb names to route names automatically, removing another place where the two have to be kept in sync by hand. For a project with many pages, that is the feature that decides whether the breadcrumbs file stays a readable map or becomes another source of duplication.

## URLs come from Laravel helpers, not from string concatenation

The URL of each breadcrumb is generated with the standard Laravel URL generation methods, and the README lists the options. You can use url('path/to/route'), which is the same as URL::to(), or secure_url('path/to/route'), or route('routename') with a parameter, a list of parameters or none, which is the same as URL::route(), or action('controller@action'), which is the same as URL::action(). The last option is to just pass a string URL such as a plain http address. The point of using the helpers rather than literals is that the links keep working when a route changes or when the application is served over https, and a route with parameters gives you the URL, the route name and the parameters separately, so a breadcrumb title can be the display name while the link carries the identifier. In the trail definitions that means a title and a URL are always pushed together, which is why the trail cannot end up with a label that is not a link, unless you deliberately push one without a URL.

## A fork with a version compatibility chart

This project is the official fork of the original Laravel Breadcrumbs by Dave James Miller, and the README is explicit that it would not have been possible without the day-one contributors of the original project. Forks of popular packages often leave the adopter with the question of which one is maintained, so the compatibility chart answers it directly. Laravel 13, 12, 11 and 10 all pair with package version 10.x, Laravel 9 and 8 pair with 9.x, and Laravel 7 and 6 pair with 8.x. For older Laravel versions the README points back at the original GitHub project, and adds that all tags have been mirrored into this package for anyone who prefers to reference it, while noting that the mirrored tags will provide no functional difference. That mirroring note is a useful detail for a team with a long-lived application, because it means the history of the package is available in one place even if the code you run comes from the original repository.

## What the repository tells you about upkeep

The top level of the tree is small and conventional for a PHP package, with composer.json as the package definition, config/ for the published configuration, resources/ for the views including the templates the config key selects, src/ for the implementation, tests/ with a phpunit.xml file for the test runner, and a UPGRADE.md file for the notes that matter when you move between major versions of the package. The MIT licence and the Packagist page as the homepage are the other two facts worth recording. The release history shows the package tracking Laravel releases rather than a fixed schedule, with 10.1.0 published on 2026-03-30, 10.0.0 on 2025-02-25 and 9.0.0 on 2024-03-12, and the last push to the repository on 2026-07-22. Since the compatibility chart shows the package major moving with the Laravel major, the practical advice for a team is to read UPGRADE.md before bumping, because the jump from a package major to the next one is where a template name or a method call is most likely to change under you.

## Conclusion

Laravel Breadcrumbs fits a Laravel team that wants one readable file to hold the site's navigation hierarchy instead of scattering breadcrumb calls through controllers and views, and the closure per breadcrumb keeps the URL generation in Laravel's own helpers. It does not fit a team on a Laravel version outside the compatibility chart, and it does not fit a project that wants breadcrumb labels to be derived automatically from routes and resources rather than declared. Before you adopt it, check which major version of the package matches your Laravel release, read UPGRADE.md in the repository before moving between package majors, and look at the JSON-LD template if search engines matter to you, since that view is a different output shape from the HTML ones and is the one to check in a page source test.

## FAQ

### How do I install Laravel Breadcrumbs?

With composer require diglactic/laravel-breadcrumbs, then publish the config file using php artisan vendor:publish --tag=breadcrumbs-config if you want to change the template, and define your breadcrumbs in a routes/breadcrumbs.php file.

### Which Laravel versions does this package support?

Laravel 13, 12, 11 and 10 are supported by package version 10.x, Laravel 9 and 8 by version 9.x, and Laravel 7 and 6 by version 8.x. For older Laravel versions the README points to the original project, whose tags have all been mirrored into this package.

### How do I change the breadcrumb markup?

Edit the view key in config/breadcrumbs.php. The built-in choices are bootstrap5, bootstrap4, bulma, foundation6, json-ld, materialize, tailwind and uikit, and you can also give the path to a custom view such as partials.breadcrumbs, or switch views at runtime.

### How do breadcrumbs get their URLs?

Through the standard Laravel URL helpers, so url, secure_url, route with a name and optional parameters, and action with a controller and action are all available, and you can also pass a plain URL string.

### Is Laravel Breadcrumbs still maintained?

The repository is not archived and the last push was on 2026-07-22, with releases 10.1.0 from 2026-03-30, 10.0.0 from 2025-02-25 and 9.0.0 from 2024-03-12.

## Sources

- [diglactic/laravel-breadcrumbs on GitHub](https://github.com/diglactic/laravel-breadcrumbs)
- [License: MIT](https://github.com/diglactic/laravel-breadcrumbs/blob/main/LICENSE)
- [Project website](https://packagist.org/packages/diglactic/laravel-breadcrumbs)
- [README](https://github.com/diglactic/laravel-breadcrumbs/blob/main/README.md)
- [Releases](https://github.com/diglactic/laravel-breadcrumbs/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/diglactic-laravel-breadcrumbs
