Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Breadcrumbs

Laravel Breadcrumbs Laravel Package

diglactic/laravel-breadcrumbs

Laravel-style breadcrumbs for your app. Define trails in a single place, render them with built-in or custom templates, and support route-bound crumbs and structured data. Official fork of Dave James Miller’s original Laravel Breadcrumbs.

View on GitHub
Deep Wiki
Context7

A simple Laravel-style way to create breadcrumbs.

Frequently asked questions about Laravel Breadcrumbs
How do I install diglactic/laravel-breadcrumbs in a Laravel project?
Run `composer require diglactic/laravel-breadcrumbs` to install the package. Publish the configuration file with `php artisan vendor:publish --provider="Diglactic\Breadcrumbs\BreadcrumbsServiceProvider"` if you need to customize defaults. The package is ready to use after installation.
What Laravel versions does this package support?
The package supports Laravel 7 through 13, with version-specific compatibility (e.g., Laravel 13 requires version 10.x). Check the [compatibility chart](https://github.com/diglactic/laravel-breadcrumbs#compatibility-chart) for exact mappings. Older versions may require the original package.
Can I define breadcrumbs dynamically, like using Eloquent models or user-specific data?
Yes, you can pass dynamic data to breadcrumbs using closures. For example, `->parent('Parent', function () { return Model::find(1)->name; })` fetches data on demand. Just ensure the closure returns a string or HTML-safe value to avoid runtime errors.
How do I customize the HTML output of breadcrumbs?
Create a custom Blade template in `resources/views/vendor/breadcrumbs/your-template.blade.php` and specify it in your `config/breadcrumbs.php` under `template`. The template receives a `$breadcrumbs` variable containing an array of breadcrumb items with `url`, `title`, and `active` properties.
Does this package support structured data like JSON-LD for SEO?
Yes, the package includes built-in support for JSON-LD structured data. Enable it in your `config/breadcrumbs.php` by setting `'structured_data' => true`, and the package will automatically generate the required markup in your view.
How do route-bound breadcrumbs work, and do they require special route naming?
Route-bound breadcrumbs automatically generate trails based on route names. Use `Breadcrumbs::route('route.name')` in your controller or middleware. For consistency, name your routes descriptively (e.g., `admin.users.index` instead of `route123`).
Will breadcrumbs impact performance in high-traffic Laravel apps?
Breadcrumbs are generated per request by default, which is lightweight but may not be optimal for high-traffic pages. Mitigate this by caching routes (`php artisan route:cache`) or using middleware to pre-generate breadcrumbs for static paths.
Can I use this package in a headless Laravel API or SPA?
While the package is designed for Blade views, you can still use it in SPAs or APIs by rendering breadcrumbs as JSON or structured data. Pass the breadcrumb trail via API responses or use client-side templates to display them dynamically.
How do I handle translations for breadcrumb titles?
Use Laravel’s built-in translation helpers like `trans('breadcrumbs.home')` within your breadcrumb definitions. For dynamic content, combine translations with closures, e.g., `->parent(trans('breadcrumbs.category'), function () { return Category::find($id)->name; })`.
Are there alternatives to diglactic/laravel-breadcrumbs for Laravel?
Alternatives include `spatie/laravel-breadcrumbs` (a more opinionated package with a different API) or `artesaos/seotools` (which includes breadcrumb functionality as part of a broader SEO suite). This package stands out for its Laravel-native design and minimal setup, making it ideal for projects prioritizing simplicity and SEO.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai