happyr/menu-builder-bundle
A Symfony bundle that simplifies creating and managing navigation menus. Define menu items and hierarchies in configuration or code, then render them in Twig templates with a clean, flexible API. Useful for site navigation, admin sidebars, and reusable menu structures.
Before anything else: this is a Symfony bundle, not a Laravel package. There is still no Laravel integration — no service provider, no facade, no config stub. You cannot composer require it into a Laravel app and expect it to work. The assessment below assumes a Symfony project, which is the only context where this package makes sense.
What 0.2.1 changes for a first-time evaluator:
composer.json almost certainly pinned PHP 7.x, which meant a hard stop on modern runtimes. That ceiling is gone. The Symfony constraint is a separate question and was not mentioned in the release notes — check it explicitly. PHP 8 support strongly suggests Symfony 5.4-era compatibility; do not assume Symfony 6/7 works.composer require happyr/menu-builder-bundle — then run composer update --dry-run in isolation before committing. A resolve failure is your signal to stop.config/bundles.php (verify the class name in src/ rather than guessing).src/ first. The bundle is small enough to read end-to-end in minutes, and it remains more reliable than the docs. Identify four things now: the menu builder service, the menu item model, the new active method on items, and any Twig extension.The release cadence improvement (first release since 2021) is a mildly positive signal, but 2 stars and zero dependents still mean you are effectively the only consumer. Budget accordingly.
Treat it as a small utility, not a framework feature. The new active method is the main thing that changes your day-to-day code.
MenuBuilder-style service that assembles items (label, URL or route, children, attributes, active flag) stays testable and cacheable. Inject it where needed.active method instead of hand-rolling an is_active attribute. Set it in the builder by comparing the item's route against the current route name (inject RequestStack or pass the route name in), then let your Twig template branch on it. This is a real ergonomic win — previously you were smuggling boolean state through the attributes array and re-checking it in templates._route parameters) are yours to implement. Consider a small isCurrentRoute() helper on your builder so templates stay dumb.{% macro %} — for a menu this small, that is often cleaner than fighting the extension.base.html.twig, inherit in children. Avoid rebuilding per request.AuthorizationCheckerInterface (or the Security helper on older Symfony). Combine with the active flag so a filtered-out item can't be rendered as active.active method narrows the gap slightly but does not close it.composer require changes that.active method is a flag, not a feature. Don't assume it inspects the request, the router, or the current URL. Confirm its signature in src/ — whether it's setActive(bool)/isActive(), a fluent active(), or something route-aware — before writing templates against it.active method may be entirely undocumented. Read src/.bin/console debug:twig and debug:container to confirm service IDs. If active throws a "call to undefined method" you're on the wrong installed version — check composer show happyr/menu-builder-bundle.How can I help you explore Laravel packages today?