xi/breadcrumbs-bundle
A lightweight breadcrumbs bundle for PHP applications that helps generate, configure, and render hierarchical navigation trails. Add breadcrumb definitions to your existing stack to improve site navigation and user orientation with minimal setup.
composer require it — you will read it as a reference implementation for route-tree breadcrumbs and port the pattern into a Laravel service provider / middleware. The score (2.43) and 10 stars reflect that it is niche and effectively unmaintained.README.md, then Resources/config/services.xml (service IDs and listener wiring), then the routing loader / defaults handling that reads breadcrumb metadata from routes, and finally the Twig template under Resources/views. Those four files tell you the whole contract: how parentage is declared, how labels resolve, and how the trail is rendered.AppKernel, enable it in config.yml, then annotate or configure routes so each route knows its parent and a display label. Render the trail in your layout with the bundle's Twig helper (confirm the exact function name in the bundle's Twig extension).home → product_list → product_show. Instead of calling $breadcrumbs->add(...) in every controller action, you declare the parent/label relationship once in routing config and let a request listener build the trail from the current route. The win is that controllers stay thin and the trail stays consistent across pages.defaults (or annotations) rather than in PHP. The canonical shape is a parent route name plus a label; the bundle walks upward from the matched route. Keep the tree shallow (3–4 levels) — deep chains become hard to reason about and expensive to resolve on every request./orders/{id}), do not try to encode a label in routing — resolve it at runtime via a small service or listener that sets the label on the request/collector after the entity is loaded. This keeps IDs and entity titles out of routing files.$this->addBreadcrumb() calls in actions. If you find yourself adding breadcrumbs manually per action, you have either a route-tree edge case or a dynamic-label case — handle both in a listener/mapper, not in the controller.<ol>/<nav aria-label="breadcrumb"> markup. Do not hardcode separators in the extension — override the bundle template in app/Resources/ to keep markup and styling under your control.BreadcrumbManager, populate it in a middleware after route resolution, declare parent/label metadata alongside routes (->defaults('breadcrumb', [...])), and expose a Blade component that iterates the trail. The structural idea transfers cleanly; the bundle code does not.NOASSERTION: the repository does not declare a recognized OSI license. Verify with the maintainer before shipping it in a commercial product; absent clarification, do not copy code verbatim.{id} leaking into labels is the most common bug. Always override labels for dynamic routes at runtime; never rely on the raw route pattern.$request->attributes->get('_route') in a kernel request listener.How can I help you explore Laravel packages today?