PHPackages                             zaichaopan/breadcrumb - 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. zaichaopan/breadcrumb

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

zaichaopan/breadcrumb
=====================

A package to add dynamic breadcrumb to your laravel app

v0.1-beta(7y ago)01MITPHPPHP &gt;=7.1.0

Since Jun 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zaichaopan/breadcrumb)[ Packagist](https://packagist.org/packages/zaichaopan/breadcrumb)[ RSS](/packages/zaichaopan-breadcrumb/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Breadcrumb
==========

[](#breadcrumb)

This package allows you to add dynamic breadcrumb to your laravel app. It is inspired by [code course](https://codecourse.com/watch/dynamic-breadcrumbs-in-laravel?part). It can be used in laravel 5.5 or higher.

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

[](#installation)

```
composer require zaichaopan/breadcrumb
```

Usage
-----

[](#usage)

- Implement **BreadcrumbLinkInterface** in your eloquent model which you want to use to generate breadcrumb.

To better understand how to use this package. Consider the following example: your app can list different products which may belong to different categories.

```
// web.php
Route::get('/categories/{category}/products/{product}', 'ProductsController@show');
```

```
// ...
class ProductsController extends Controller
{
    public function show(Category $category, Product $product)
    {
        // ...
        return view('product.show', compact('product'));
    }
}
```

To generate the breadcrumb link in the **products.show** view. You need to implement the **BreadcrumbLinkInterface** in your **Category** and **Product** model.

There is only one method in the **BreadcrumbLinkInterface** : **LinkText**. It is used to define the text of the link when generating the breadcrumb. This package needs to know it because you may have model id in the url or you may replace the id with uuid or slug in the url. We don't want to use any one of them for the text for the url when generating the breadcrumb.

To implement the interface in the model:

```
// Category.php
class Category extends Model implements BreadcrumbLinkInterface
{
    public function linkText() : string
    {
        // you want to display category name in the breadcrumb link
        return $this->name;
    }
}
```

```
// Product.php
class Product extends Model implements BreadcrumbLinkInterface
{

    public function linkText(): string
    {
         // you want to display product name in the breadcrumb link
        return $this->name;
    }
}
```

- Include breadcrumb nav link in the view

This package provides a default bootstrap4-style breadcrumb nav partial view.

To include in your **products.show** view:

```
@include('breadcrumb::_nav')
```

If you want to customize the breadcrumb nav. You can publish the view.

```
php artisan vendor:publish
```

Then choose the provider: **Zaichaopan\\Breadcrumb\\BreadcrumbServiceProvider**

That is all you need to do to use this package.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

2881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dfb2782ff22c81ce8095946983c3d437156ed09b132ec93727da68a14fa7db0?d=identicon)[zaichaopan](/maintainers/zaichaopan)

---

Top Contributors

[![zaichaopan](https://avatars.githubusercontent.com/u/16104572?v=4)](https://github.com/zaichaopan "zaichaopan (15 commits)")

---

Tags

breadcrumbslaravelphplaravelbreadcrumb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zaichaopan-breadcrumb/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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