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(8y ago)01MITPHPPHP &gt;=7.1.0

Since Jun 21Pushed 8y ago1 watchersCompare

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

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

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

2930d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16104572?v=4)[zaichaopan](/maintainers/zaichaopan)[@zaichaopan](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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