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 Builder Bundle

Menu Builder Bundle Laravel Package

forci/menu-builder-bundle

A Symfony bundle that integrates the MenuBuilder library, giving you a flexible object-oriented API for defining, rendering, and manipulating navigation menus in Twig templates. Configure menus in PHP, nest items with permissions, and output clean HTML.

View on GitHub
Deep Wiki
Context7

A simple, standalone Menu Builder for Symfony 2 Applications

Frequently asked questions about Menu Builder Bundle
What is forci/menu-builder-bundle?
It is a Symfony bundle that wraps the MenuBuilder library and knplabs/knp-menu, giving developers a fluent, object-oriented API for defining navigation menus in PHP. It supports labels, routes or URIs, attributes, nested child items, and Twig rendering helpers. The package centralizes menu structure so navigation is not scattered across templates. It is a Symfony integration, not a Laravel package.
Does forci/menu-builder-bundle work with Laravel?
No. It is a Symfony bundle with Symfony dependency-injection integration and Twig helpers, and it has no Laravel service provider, facade, Blade directives, or config publish tags. Installing it in a Laravel app would pull Symfony framework packages and fail to boot cleanly. For Laravel, use a Laravel-native menu package or reimplement the builder pattern in your own service.
How do I install forci/menu-builder-bundle?
In a Symfony application you would install it with Composer, enable the bundle in the kernel or bundles configuration, define menus in PHP services or configuration, and render them in Twig templates. The exact steps depend on the Symfony version and the bundle's service configuration. This installation path does not apply to Laravel projects.
Can I use the menu builder with Blade instead of Twig?
The package's rendering helpers are Twig-oriented and produce a KnpMenu ItemInterface tree, so Blade cannot consume them directly. You could use the builder to construct a tree and then convert it to arrays or render it manually in Blade, but that means discarding the Twig integration. In Laravel it is usually cleaner to implement a small menu builder and Blade component yourself.
Is forci/menu-builder-bundle licensed for commercial use?
The repository shows NOASSERTION and no declared license, which means there is no explicit grant of rights. Absent a license, the default legal posture is all rights reserved, so copying the code into a commercial codebase is a legal exposure. Do not vendor or fork it until the license is clarified in writing.
Is forci/menu-builder-bundle actively maintained?
There is no evidence of tagged releases, CI, tests, or recent commits, and the project shows zero stars, dependents, and forks. That means no field testing, no reported edge cases, and no security-patching path. Treat it as a design reference rather than a production dependency.
What Laravel alternatives should I use for building menus?
Maintained Laravel-native options include spatie/menu and lavary/laravel-menu, both of which fit Blade and Laravel routing better than a Symfony bundle. Wrap whichever you choose behind an internal interface such as MenuBuilder or MenuRenderer so the decision stays reversible. If control matters more than speed, a small in-house menu tree is only about 150 to 200 lines of straightforward code.
How do I handle active menu states and route matching in Laravel?
This bundle relies on Symfony route-based active-state detection and Twig helpers, which do not transfer to Laravel. In Laravel you would use request()->routeIs() or the Route facade inside your own renderer or Blade component. Keep active-state logic in your application layer rather than trying to port the bundle's Twig helper.
Can I port the forci/menu-builder-bundle builder API to Laravel?
Yes, the portable part is the fluent builder surface: addItem, addChild, setLabel, setUri, and setAttribute, which produce a menu tree. That is roughly 150 to 200 lines if reimplemented on standalone knplabs/knp-menu or plain PHP. Discard the Symfony DI extension, service XML, and Twig helpers, and put the builder behind your own contract.
What are the production risks of using this package in a Laravel application?
The package will not boot as-installed in Laravel because it depends on Symfony framework integration, and it is unlicensed, unmaintained, and untested by any community. Menu systems have known hard parts such as recursion on malformed parent references, N+1 child loading, and ordering drift that this project has not been exercised against. Introducing it into a commercial Laravel codebase creates legal, maintenance, and review risk for a commodity feature. Use an approved Laravel-native package or build a small internal service instead.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource