PHPackages                             bored-programmers/larabreadcrumb - 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. bored-programmers/larabreadcrumb

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

bored-programmers/larabreadcrumb
================================

LaraBreadcrumb is a comprehensive Laravel package that provides an easy and flexible way to generate breadcrumbs for your Laravel applications. It supports automatic breadcrumb generation based on your routes, customization of breadcrumb titles, and hiding certain breadcrumbs.

v2.1.1(2y ago)233MITPHPPHP ^8.1

Since Dec 24Pushed 2y agoCompare

[ Source](https://github.com/Bored-Programmers/larabreadcrumb)[ Packagist](https://packagist.org/packages/bored-programmers/larabreadcrumb)[ RSS](/packages/bored-programmers-larabreadcrumb/feed)WikiDiscussions master Synced 1mo ago

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

LaraBreadcrumb
==============

[](#larabreadcrumb)

LaraBreadcrumb is a Laravel package that simplifies the creation of breadcrumbs in Laravel applications.

**NOTE**

This was my first attempt at using Laravel containers and services. If you have any suggestions for improvement, please let me know.

[![Laravel Version](https://camo.githubusercontent.com/01aebe4da873379e61acc61dd8b49c1e80076ed22c454668416edff1bdacb6e6/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d6c61726176656c266d6573736167653d25453225383925413531302e3026636f6c6f723d303037384245266c6f676f3d6c61726176656c)](https://laravel.com)[![Version](https://camo.githubusercontent.com/5bb13b7281d4ba2b38a4e43248aa42a3981917683c435ed0ecfbe3bb51421407/687474703a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c61726162726561646372756d622f76657273696f6e)](https://packagist.org/packages/bored-programmers/larabreadcrumb)[![Total Downloads](https://camo.githubusercontent.com/501030e76fa69a08d3a96ae0c3e500f06c67e8b3050ab6248a354a6fad4d75a7/687474703a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c61726162726561646372756d622f646f776e6c6f616473)](https://packagist.org/packages/bored-programmers/larabreadcrumb)[![License](https://camo.githubusercontent.com/0e622a3644a739793330fb7cd2180221f7422f5f3b86831954230a6758c86ea0/687474703a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c61726162726561646372756d622f6c6963656e7365)](https://packagist.org/packages/bored-programmers/larabreadcrumb)[![PHP Version Require](https://camo.githubusercontent.com/95f31e1c35036cf93da15e97ee4b61fb700e7f0e9138eacda23195e48f420a70/687474703a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c61726162726561646372756d622f726571756972652f706870)](https://packagist.org/packages/bored-programmers/larabreadcrumb)

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Basic Usage](#basic-usage)
    - [Displaying Breadcrumbs](#displaying-breadcrumbs)
    - [Customizing Breadcrumbs](#customizing-breadcrumbs)
    - [Prefixing Breadcrumbs](#prefixing-breadcrumbs)
    - [Hiding Breadcrumbs](#hiding-breadcrumbs)
    - [Disabling Breadcrumbs](#disabling-breadcrumbs)
    - [Translating Breadcrumbs](#translating-breadcrumbs)
    - [Publishing Views](#publishing-views)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [License](#license)
- [Contact Information](#contact-information)
- [Credits](#credits)
- [Acknowledgments](#acknowledgments)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0 or higher

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

[](#installation)

To install LaraBreadcrumb, use the following command:

```
composer require bored-programmers/larabreadcrumb
```

Basic Usage
-----------

[](#basic-usage)

By default, LaraBreadcrumb generates breadcrumbs automatically based on the route. It uses the route parameter values as the breadcrumb titles. For example, for a route like `admin/customers/1`, it generates a breadcrumb like this: `Admin / Customers / 1`.

### Displaying Breadcrumbs

[](#displaying-breadcrumbs)

```

```

### Customizing Breadcrumbs

[](#customizing-breadcrumbs)

For a route like `Route::get('/users/{customer}')`, LaraBreadcrumb generates a breadcrumb like this: `Users / 1`. To customize the breadcrumb, you can use the `BreadcrumbService` class:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

BreadcrumbService::update()
    ->setAccessors([
        'customer' => fn($model) => $model->name
        'customer' => fn(User $user) => $user->name
        'customer' => 'name'
    ]);
])
```

This generates a breadcrumb like this: `Users / John`. The key `customer` is the name of the route parameter, and the value is the accessor. You can use a closure or a string.

You can also add a single accessor conditionally:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

BreadcrumbService::update()
    ->setAccessors([
        'customer' => fn($model) => $model->name
        'customer' => fn(User $user) => $user->name
        'customer' => 'name'
    ]);
])

if (true) {
  BreadcrumbService::update()
      ->addAccessor('customer', fn($model) => $model->name);
  ])
}
```

### Prefixing Breadcrumbs

[](#prefixing-breadcrumbs)

By default, breadcrumbs don't have a prefix. To add a prefix to the breadcrumbs, use the `BreadcrumbService` class:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

# Route::get('/users/{user}/comments/{comment}');

BreadcrumbService::update()
    ->setPrefix('breadcrumb');
])
```

This generates a breadcrumb like this: `breadcrumb.users / 1 / breadcrumb.comments / 1`.

**Note:** It's recommended to use a prefix when using translation to prevent conflicts. For example, for a route like `Route::get('admin/users')`, it generates a breadcrumb like this: `admin / users`. This isn't a problem until you have a translation file `admin.php`. Then it gives you an error `array to string conversion`.

### Hiding Breadcrumbs

[](#hiding-breadcrumbs)

You can hide certain breadcrumbs:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Route::get('/users/{user}/comments/{comment}');

 $breadcrumbs = BreadcrumbService::update()->hide('comments');
 $breadcrumbs = BreadcrumbService::update()->hide(['comments', 'users']);
```

This hides the `comments` breadcrumb. The first result will be `Users / {user} / {comment}`, and the second will be `{user} / {comment}`.

**To hide dynamic segments, use curly braces `{}`:**

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Route::get('/users/{user}/comments/{comment}');

 $breadcrumbs = BreadcrumbService::update()->hide('{comment}');
 $breadcrumbs = BreadcrumbService::update()->hide(['{user}', '{comment}']);
```

This hides the dynamic segment from the breadcrumb. The first result will be `Users / {user} / Comments`, and the second will be `Users / Comments`.

### Disabling Breadcrumbs

[](#disabling-breadcrumbs)

You can disable click events on certain breadcrumbs.

**Note:** This doesn't hide the link; it only disables the click event.

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Route::get('/users/{user}/comments/{comment}');

 $breadcrumbs = BreadcrumbService::update()->disable('comments');
 $breadcrumbs = BreadcrumbService::update()->disable(['comments', 'users']);
```

After this, you won't be able to click on the `comments` breadcrumb in the first example and on the `comments`and `users` breadcrumbs in the second example.

To disable dynamic segments, use curly braces `{}`:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Route::get('/users/{user}/comments/{comment}');

 $breadcrumbs = BreadcrumbService::update()->disable('{comment}');
 $breadcrumbs = BreadcrumbService::update()->disable(['{user}', '{comment}']);
```

After this, you won't be able to click on the `comment` breadcrumb in the first example and on the `user` and `comment`breadcrumbs in the second example.

### Translating Breadcrumbs

[](#translating-breadcrumbs)

You can translate certain breadcrumbs or all breadcrumbs by default:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Translate certain segments
BreadcrumbService::update()->translate('users');
BreadcrumbService::update()->translate(['users', 'comments']);

// Translate all segments by default
BreadcrumbService::update()->translateAll();
```

If you want to translate all breadcrumbs but don't want to translate certain segments, you can use the `dontTranslate`method:

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

BreadcrumbService::update()->translateAll(true);

// Don't translate certain segments
BreadcrumbService::update()->dontTranslate('users');
BreadcrumbService::update()->dontTranslate(['users', 'comments']);
```

This ensures that the 'users' segment isn't translated in the first example, and the 'users' and 'comments' segments aren't translated in the second example, even if translateAll is set to true.

If you want to translate dynamic segments, you must use curly braces {}.

```
use BoredProgrammers\LaraBreadcrumb\Service\BreadcrumbService;

// Route::get('/users/{user}/comments/{comment}');

BreadcrumbService::update()->translate('{user}');
BreadcrumbService::update()->translate(['{user}', '{comment}']);
```

Publishing views
----------------

[](#publishing-views)

If you want to customize the views, you can publish them with this command:

```
php artisan vendor:publish --tag=larabreadcrumb-views
```

Contributing
------------

[](#contributing)

We welcome contributions to LaraBreadcrumb. If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. We have a few requirements for contributions:

- Follow the PSR-2 coding standard.
- Only use pull requests for contributions.

Changelog
---------

[](#changelog)

For a detailed history of changes, see [releases](https://github.com/Bored-Programmers/larabreadcrumb/releases) on GitHub.

License
-------

[](#license)

This project is licensed under the [MIT license](https://github.com/Bored-Programmers/larabreadcrumb/blob/main/LICENSE.md).

Contact Information
-------------------

[](#contact-information)

For any questions or concerns, please feel free to create a [discussion](https://github.com/Bored-Programmers/larabreadcrumb/discussions) on GitHub.

Credits
-------

[](#credits)

Created by [Matěj Černý](https://github.com/LeMatosDeFuk)from [Bored Programmers](https://github.com/Bored-Programmers).

Acknowledgments
---------------

[](#acknowledgments)

We would like to thank all the contributors who have helped to make LaraBreadcrumb a better package.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~2 days

Total

11

Last Release

857d ago

Major Versions

v1.0.1 → v2.0.02023-12-29

### Community

Maintainers

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

---

Top Contributors

[![LeMatosDeFuk](https://avatars.githubusercontent.com/u/45625770?v=4)](https://github.com/LeMatosDeFuk "LeMatosDeFuk (21 commits)")

---

Tags

breadcrumb-generationbreadcrumb-generatorbreadcrumbslaravellaravel-breadcrumbslaravel-navigationlaravel-path-generatornavigationroute-breadcrumbslaravelnavigationbreadcrumbsLaravel-Navigationlaravel-breadcrumbsbreadcrumb generationroute breadcrumbslaravel automatic breadcrumbsautomatic breadcrumbs

### Embed Badge

![Health badge](/badges/bored-programmers-larabreadcrumb/health.svg)

```
[![Health](https://phpackages.com/badges/bored-programmers-larabreadcrumb/health.svg)](https://phpackages.com/packages/bored-programmers-larabreadcrumb)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[robertboes/inertia-breadcrumbs

Laravel package to automatically share breadcrumbs to Inertia

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

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)

PHPackages © 2026

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