PHPackages                             shahrakii/autocrumb - 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. shahrakii/autocrumb

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

shahrakii/autocrumb
===================

Automatic breadcrumb generator for Laravel

10PHP

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/Shahrakii/autocrumb)[ Packagist](https://packagist.org/packages/shahrakii/autocrumb)[ RSS](/packages/shahrakii-autocrumb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🧭 Autocrumb
===========

[](#-autocrumb)

> Automatic, translated breadcrumbs for Laravel — zero config, zero effort.

[![Laravel](https://camo.githubusercontent.com/56fef1efbd604711ca6bcaf7a2217af6e022b5a336e6ab3c1837b6f76484d2b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/9847427b3ad37d5f2f3122f63983977e1b0ab038e06a24272d8c4514725c11a0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75653f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://php.net)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)

Autocrumb reads your current URL, splits it into segments, translates each one using built-in Persian and English dictionaries, and renders a beautiful RTL-ready breadcrumb — automatically.

---

✨ Features
----------

[](#-features)

- 🔍 **Auto-detection** — reads `request()->segments()` with no manual route registration
- 🌐 **Persian &amp; English** — built-in `fa` / `en` translation dictionaries
- 🎨 **Beautiful default view** — dark glassmorphism style, RTL-ready, Vazirmatn font
- ⚙️ **Fully configurable** — separator, home label, ignored segments, CSS classes
- 🧩 **Facade + direct call** — use however you prefer
- 📦 **Laravel auto-discovery** — no manual provider registration needed
- 🪶 **Zero dependencies** — pure PHP + Laravel, nothing else

---

📦 Installation
--------------

[](#-installation)

### From a local path (development)

[](#from-a-local-path-development)

Add to your Laravel project's `composer.json`:

```
"repositories": [
    {
        "type": "path",
        "url": "./packages/autocrumb"
    }
],
"require": {
    "shahrakii/autocrumb": "*@dev"
}
```

Then run:

```
composer update
php artisan optimize:clear
```

### From Packagist (once published)

[](#from-packagist-once-published)

```
composer require shahrakii/autocrumb
```

---

🚀 Quick Start
-------------

[](#-quick-start)

Drop this anywhere in your Blade file:

```
{!! \Shahrakii\Autocrumb\Facades\Autocrumb::generate() !!}
```

Force Persian:

```
{!! \Shahrakii\Autocrumb\Facades\Autocrumb::generate(null, 'fa') !!}
```

Force English:

```
{!! \Shahrakii\Autocrumb\Facades\Autocrumb::generate(null, 'en') !!}
```

---

🎯 Output Example
----------------

[](#-output-example)

For URL `/admin/product/create` with locale `fa`:

```
خانه  ›  مدیریت  ›  محصولات  ›  ایجاد جدید

```

For locale `en`:

```
Home  ›  Admin  ›  Products  ›  Create New

```

---

⚙️ Configuration
----------------

[](#️-configuration)

Publish the config file:

```
php artisan vendor:publish --tag=autocrumb-config
```

This creates `config/autocrumb.php`:

```
return [

    // Default locale: 'en' or 'fa' — null = uses app()->getLocale()
    'locale' => null,

    // Show a "Home" item as the first crumb
    'show_home' => true,

    // URL for the home crumb
    'home_url' => '/',

    // Separator between crumbs (HTML allowed)
    'separator' => '›',

    // Map URL segments to custom labels (takes priority over lang files)
    'segment_labels' => [
        // 'admin' => 'Control Panel',
        // 'shop'  => 'فروشگاه',
    ],

    // Segments to skip entirely
    'ignored_segments' => [],

    // Auto-capitalize labels when no translation found
    'auto_capitalize' => true,

    // Replace hyphens/underscores with spaces
    'replace_hyphens' => true,

    // Whether the last crumb should be a link
    'last_item_link' => false,

    // CSS classes
    'wrapper_class' => 'breadcrumb',
    'item_class'    => 'breadcrumb-item',
    'active_class'  => 'active',

];
```

---

🎨 Custom View
-------------

[](#-custom-view)

Publish the view to customize it:

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

This copies the view to `resources/views/vendor/autocrumb/breadcrumbs.blade.php`.

Or pass your own view name:

```
{!! \Shahrakii\Autocrumb\Facades\Autocrumb::generate('my-custom.breadcrumbs', 'fa') !!}
```

Your custom view receives these variables:

VariableTypeDescription`$items``array`Array of breadcrumb items`$separator``string`Separator string from config`$wrapperClass``string`CSS class for ```$itemClass``string`CSS class for each ```$activeClass``string`CSS class for active ``Each item in `$items`:

```
[
    'label'  => 'Products',   // translated label
    'url'    => '/admin/product',
    'active' => false,        // true for the last item
]
```

---

🔧 Raw Data
----------

[](#-raw-data)

If you want to build your own HTML from scratch:

```
@php
    $crumbs = \Shahrakii\Autocrumb\Facades\Autocrumb::getBreadcrumbData('fa');
@endphp

@foreach($crumbs as $crumb)
    {{ $crumb['label'] }}
@endforeach
```

---

🌍 Adding Translations
---------------------

[](#-adding-translations)

Publish the lang files:

```
php artisan vendor:publish --tag=autocrumb-lang
```

This copies them to `resources/lang/vendor/autocrumb/`. Add your own keys to `fa.json` or `en.json`:

```
{
    "shop":     "فروشگاه",
    "checkout": "تسویه حساب",
    "wishlist": "علاقه‌مندی‌ها"
}
```

Or map segments directly in config without touching lang files:

```
'segment_labels' => [
    'shop'     => 'فروشگاه',
    'checkout' => 'تسویه حساب',
],
```

---

📁 Package Structure
-------------------

[](#-package-structure)

```
autocrumb/
├── composer.json
├── config/
│   └── autocrumb.php
├── resources/
│   ├── lang/
│   │   ├── en.json
│   │   └── fa.json
│   └── views/
│       └── breadcrumbs.blade.php
└── src/
    ├── Facades/
    │   └── Autocrumb.php
    ├── Autocrumb.php
    └── AutocrumbServiceProvider.php

```

---

📋 Requirements
--------------

[](#-requirements)

RequirementVersionPHP8.1+Laravel10 / 11 / 12---

📄 License
---------

[](#-license)

MIT — free to use, modify, and distribute.

---

👤 Author
--------

[](#-author)

Made by **Shahrakii**

> Built to scratch an itch — automatic, translated breadcrumbs with zero boilerplate.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance57

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/04da862c17726c81482c803968adadd673dd6a02abd94af74e6c7099c8296253?d=identicon)[Shahryar2014](/maintainers/Shahryar2014)

---

Top Contributors

[![Shahrakii](https://avatars.githubusercontent.com/u/121825501?v=4)](https://github.com/Shahrakii "Shahrakii (7 commits)")

### Embed Badge

![Health badge](/badges/shahrakii-autocrumb/health.svg)

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

###  Alternatives

[monsoonconsulting/magento2-pwa

Adds a service worker to Magento2 to enable PWA features.

2322.9k](/packages/monsoonconsulting-magento2-pwa)[yii2mod/yii2-selectize

selectize.js wrapper for yii2

1730.7k1](/packages/yii2mod-yii2-selectize)

PHPackages © 2026

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