knplabs/knp-menu-bundle
KnpMenuBundle integrates the KnpMenu PHP library with Symfony, making it easy to build feature-rich, flexible menus in your Symfony applications with minimal configuration.
knplabs/knp-menu-bundle is a Symfony-specific bundle, not a Laravel package. It ships Twig helpers, Symfony service-container wiring, and bundle configuration. For a Laravel product, the correct decision is do not adopt the bundle as-is — evaluate the underlying, framework-agnostic KnpMenu core or a Laravel-native alternative (e.g., spatie/menu) instead.RouteVoter can now be disabled via configuration. This enables product-level control of "which nav item lights up" — useful for multi-section products, A/B-tested navigation variants, or where URL matching produces false positives.[AsMenuBuilder] autoconfiguration), aligning with a "navigation as a component, not templates" direction.Adopt (Symfony only) if:
Look elsewhere if:
KnpMenu core with a custom adapter.For executives: "This is a mature, MIT-licensed Symfony package (~1.4K GitHub stars, active releases into late 2026) that eliminates custom work for dynamic, permission-aware navigation. The catch is stack fit: it will not plug into Laravel. So the recommendation is a conditional approval — adopt for any Symfony service in the portfolio, and for Laravel products route the same requirement to a Laravel-native menu library or the package's framework-agnostic core. Net effect: we avoid rebuilding navigation per product while keeping each stack on idiomatic tools."
For engineering: "On Symfony, use menu-builder services plus Twig rendering; the v3.6.0 [AsMenuBuilder] attribute and the v3.8.0 option to disable the default RouteVoter give us cleaner active-state control and less boilerplate. Require PHP 8.2+ and a supported Symfony version, and remove reliance on the deprecated PHP templating integration before upgrading. On Laravel, do not attempt to bridge the bundle — evaluate the standalone KnpMenu core or a native equivalent."
For product/design: "Navigation rules (which item is active, which items appear for which user) become explicit, testable backend logic instead of template conditionals — faster to change and safer to A/B test. Interactive or real-time menu behavior remains a frontend concern and is out of scope for this dependency."
How can I help you explore Laravel packages today?