- Can I use igdr/config-knp-menu-bundle in a Laravel application?
- No. It is a Symfony bundle whose value depends on Symfony bundle discovery, the Extension/Configuration config tree, service container compilation, and the knp_menu.factory service, none of which exist in Laravel. There is no supported adapter that preserves its behavior, so treat it as a pattern to borrow rather than a dependency to install.
- What does this package actually do?
- It adds configuration-driven menu definitions on top of KnpMenuBundle, letting you declare menus and items in YAML across project bundles instead of writing PHP menu builders by hand. At compile time it collects those definitions and hydrates KnpMenuBundle's MenuBuilder and MenuItem tree. All of this is Symfony-specific.
- Does it support Laravel 10 or 11?
- No Laravel version is supported. The package ships no Laravel service provider, no Laravel config integration, and no route or middleware awareness. For Laravel, use spatie/laravel-menu or a thin custom loader hydrated from YAML.
- Which Symfony and KnpMenuBundle versions does it support?
- The repository context does not state its constraints, so verify composer.json for the PHP requirement, Symfony 6.4/7.x support, and alignment with the knplabs/knp-menu-bundle major before anything else. Both are hard gates, and with zero dependents you should expect to be the first to hit incompatibilities.
- What is the best Laravel alternative for config-driven menus?
- Use spatie/laravel-menu for tree building and route-aware items, or a thin custom Menu value object hydrated from config/menus/*.yaml via symfony/yaml, which many Laravel stacks already ship transitively. Add a php artisan menu:cache command that compiles YAML to a PHP array for production, mirroring Laravel's config-cache idiom. Avoid importing Symfony's DI or config components for a single feature.
- How do I port the YAML menu schema to Laravel?
- Extract and document the bundle's YAML schema as an internal spec, then implement a MenuRegistry singleton bound in a service provider. Load YAML from config/menus/ and per-module menus/*.yaml, and hydrate into spatie/laravel-menu or a custom MenuItem DTO with route-name, URL, icon, permission, and translation-key fields. Finish with a menu:cache command for production compilation.
- Is this package actively maintained and safe for production?
- The evaluation reports a single-maintainer package with 0 stars, 0 dependents, and a score of 0.03, with no evidence of production usage or community validation of the schema or edge cases. There is no downstream pressure to fix issues, so assume no security response process. Check the last commit date before relying on it anywhere.
- How are menu merge conflicts between bundles resolved?
- The docs imply a compile-time collection order across project bundles, but the precedence rule (last-wins, first-wins, or error) is not documented. You would need to inspect the Extension and config-tree code to confirm behavior. This hidden coupling to bundle ordering is a likely source of subtle bugs, so define explicit precedence if you port the concept.
- Does it support translation keys, route generation, and voter-based visibility?
- These are flagged as open questions in the evaluation, not confirmed features, yet they are the three things every real menu needs. Verify them in the source before adopting. If you port the YAML schema to Laravel, include explicit fields for translation keys, route names, and permission or voter-based visibility.
- How should I test a config-driven menu implementation in Laravel?
- Test YAML parsing, merge precedence, route-name resolution, permission filtering, translation rendering, and cache compilation. Use orchestra/testbench to bind the service provider and assert the resulting menu tree structure, and add golden-file tests for the compiled array. These tests catch the schema and precedence edge cases the original bundle never validated.