Weave 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
Menu Bundle

Menu Bundle Laravel Package

nucleos/menu-bundle

A Symfony bundle for building and rendering menus from a fluent PHP API, with support for nested items, attributes, translation, current-item matching, and Twig rendering. Configure menus in services and output accessible markup.

View on GitHub
Deep Wiki
Context7

Nucleos MenuBundle is a Symfony bundle for creating and managing database-backed navigation menus. It provides Menu and MenuItem entities with a hierarchical tree structure, integrates with KnpMenu for rendering, and lets you define menus in code or through admin tooling. Ideal for centralizing site navigation and keeping menus editable without redeploying.

  • Doctrine-backed Menu and MenuItem entities
  • Hierarchical, sortable menu trees
  • KnpMenu integration for flexible rendering
  • Admin integration for menu management
  • Configurable routes and URLs for menu items
Frequently asked questions about Menu Bundle
Is nucleos/menu-bundle a Laravel package?
No. nucleos/menu-bundle is a Symfony bundle: it ships a Bundle class, a dependency-injection extension with a config tree, and services wired into the Symfony container, so there is no Laravel service provider or facade to auto-discover. Laravel has no bundle, extension or compiler-pass lifecycle, so consuming it would mean re-registering its underlying services by hand and effectively maintaining a fork. If you are on Laravel, use a native package such as spatie/laravel-menu or lavary/laravel-menu, or port the pattern into a small service provider.
How do I install nucleos/menu-bundle in a Symfony application?
Run composer require nucleos/menu-bundle, then register the bundle in config/bundles.php and add a configuration file for the extension's config tree. Because it is a standard Symfony bundle, wiring happens at kernel boot and cache warmup, so you normally do not need manual service definitions. Expect the integration to take minutes to hours in a Symfony 6 or 7 app, not days.
Which Symfony and PHP versions does nucleos/menu-bundle support?
That is defined by the version constraints in the package's composer.json, so check them on Packagist before committing. Bundles of this type typically pin Symfony major versions, which means a Symfony major upgrade can strand you on an older release. Confirm there is a supported long-term-support path for the Symfony and PHP versions you actually run.
How do I define a menu with nucleos/menu-bundle?
Menus are defined statically in configuration and exposed as container services, so you describe the hierarchy in YAML or PHP config rather than assembling it at runtime. The bundle provides Doctrine-backed menu and menu item entities plus services for building the hierarchy from your definitions. That makes it a definition layer, which lets you move existing hardcoded or array-literal menus into config one menu at a time.
Does NucleosMenuBundle render menus in Twig, or does it rely on KnpMenu?
The bundle's job is defining menus, not rendering them; rendering is delegated, typically to KnpMenu-style consumers, with straightforward Twig integration for the final output. Whether it wraps KnpMenuBundle or stands alone is worth verifying in its composer.json, because declaring KnpMenu as a dependency means inheriting a second project's maintenance risk. Keeping your existing render layer as the boundary is the safest approach during migration.
Does nucleos/menu-bundle require Doctrine?
Yes, it ships Doctrine-backed menu and menu item entities, so it expects a Doctrine ORM setup with the usual entity mapping and schema. An application without Doctrine, or one using a different persistence layer, is therefore a poor fit. Plan for the entity tables in your migration and deployment process.
Can NucleosMenuBundle handle permission-aware or runtime-dynamic menus?
The bundle is built around static, config-driven menu definitions exposed as services, so the natural fit is menus that are known ahead of time. How much runtime mutation it supports, for example hiding items based on roles or the authenticated user, is worth verifying against its API before you commit. If your navigation depends heavily on authorization state, test that scenario early, because it decides whether the bundle can survive your auth model.
Is nucleos/menu-bundle actively maintained and safe for production?
Be cautious: the project has very low adoption (roughly six GitHub stars and no dependents), which means no downstream battle-testing of upgrade paths, and a single effective maintainer. Check the release cadence over the last 24 months and verify release dates on Packagist and GitHub tags, since metadata in some feeds can look future-dated or synthetic. Review CI status and whether the test suite includes integration tests against the Symfony versions you run. The MIT license is clean, so legal risk is low even if maintenance risk is not.
What is the best alternative to nucleos/menu-bundle for Laravel?
Use a native Laravel package: spatie/laravel-menu or lavary/laravel-menu both solve hierarchical menus without a Symfony bundle lifecycle. Alternatively, treat nucleos/menu-bundle as a reference implementation and port the pattern with a config/menus.php file, a MenuBuilder singleton, a Menu facade and a Blade component, which is roughly a day of work and removes the single-maintainer dependency. Do not attempt to shim a Symfony bundle into Laravel.
Is nucleos/menu-bundle MIT licensed?
Yes, it is released under the MIT license, so there is no copyleft contamination and it is safe to use in commercial and closed-source applications. The license is the low-risk part of the assessment; the real risks are fit, since it is a Symfony bundle and not a Laravel package, plus maintenance. Keep the license file and attribution in place when you redistribute.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo