noith/customizable-breadcrumbs

Customizable breadcrumbs Blade component for Laravel

Maintainers

Package info

gitlab.com/noith/customizable-breadcrumbs

Issues

pkg:composer/noith/customizable-breadcrumbs

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

dev-master 2026-06-05 02:11 UTC

This package is auto-updated.

Last update: 2026-06-04 23:14:05 UTC


README

Breadcrumb navigation for Laravel 12–13. Bootstrap-compatible HTML, Schema.org JSON-LD, and a simple helper API.

Installation

composer require noith/customizable-breadcrumbs

The service provider is auto-discovered.

Usage

Add items anywhere in your controller, middleware, or view:

breadcrumb_add('Home', '/');
breadcrumb_add('Blog', '/blog');
breadcrumb_add('Post Title');        // no URL — renders as plain text

Render in your layout:

<x-customizable-breadcrumbs::breadcrumbs />

Both components skip rendering automatically when there are no items.

Schema.org

<x-customizable-breadcrumbs::schema-org />

Renders a <script type="application/ld+json"> tag with a BreadcrumbList. Items without a URL omit the item property, which is valid Schema.org.

For API responses or custom templates, get the data directly:

app(\Noith\Breadcrumbs\BreadcrumbsManager::class)->toSchemaArray();

Helper API

HelperReturnsDescription
breadcrumb_add($label, $url = '')BreadcrumbsManagerAppend item
breadcrumb_prepend($label, $url = '')BreadcrumbsManagerPrepend item
breadcrumb_add_once($label, $url = '')BreadcrumbsManagerAppend only if label+url not already present
breadcrumb_pop()array\|nullRemove and return last item
breadcrumb_last()array\|nullRead last item without removing
breadcrumb_items()arrayReturn all items
breadcrumb_clear()voidRemove all items

URL trimming is applied automatically — ' /path ' and '/path' are treated as identical.

Preventing duplicates

Useful when middleware and a controller both want to add the home breadcrumb:

// in middleware
breadcrumb_add_once('Home', '/');

// in controller — silently skipped
breadcrumb_add_once('Home', '/');

Editing the last item

breadcrumb_add('Draft title', '/posts/1');

// later, once the title is known:
breadcrumb_pop();
breadcrumb_add('Final title', '/posts/1');

Customising the template

Publish the views and edit them directly — there is no config file:

php artisan vendor:publish --tag=customizable-breadcrumbs-views

This copies both templates to resources/views/vendor/customizable-breadcrumbs/.

Long-running servers (Octane, RoadRunner)

BreadcrumbsManager is registered as a scoped binding — it is automatically reset at the start of each request. No additional configuration required.

Requirements

  • PHP 8.2+
  • Laravel 12 or 13