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

Easy Menu Bundle Laravel Package

agence-adeliom/easy-menu-bundle

Symfony bundle adding a basic menu system for EasyAdmin. Manage menus from your dashboard, with optional Gedmo Tree support for nested items. Supports Symfony 6.4/7.x (v3) and earlier branches for older Symfony/PHP versions.

View on GitHub
Deep Wiki
Context7

Easy Menu Bundle provides a simple, Doctrine-backed menu management system for EasyAdmin on Symfony. It integrates into your dashboard to let admins create and organize menus, with optional Gedmo Tree support for hierarchical structures.

Designed for modern Symfony/PHP versions, it installs via Symfony Flex and works with standard Doctrine schema updates or migrations.

  • EasyAdmin integration via configureMenuItems() to manage menus in the back office
  • Doctrine ORM entities for persistent menu storage
  • Optional tree extension (Gedmo) for nested menu structures
  • Supports Doctrine migrations or direct schema updates
  • Maintained branches for Symfony 4.4 → 7.x and PHP 7.2.5 → 8.2+
Frequently asked questions about Easy Menu Bundle
Can I use Easy Menu Bundle directly in Laravel, or is it strictly for Symfony?
Easy Menu Bundle is designed for Symfony and EasyAdmin, so it won’t work out-of-the-box in Laravel. However, you can adapt its core logic—like the Gedmo Tree-based menu structure—by using Doctrine ORM (via `doctrine/doctrine-bundle`) or Eloquent with custom tree traits. The bundle’s menu-building logic can be replicated in Laravel services, though you’d need to replace Twig with Blade templates.
What Laravel alternatives exist for hierarchical menus like Easy Menu Bundle?
For Laravel, consider `spatie/laravel-menu`, which offers a native Eloquent-based menu system without Symfony dependencies. Alternatively, build a custom solution using Eloquent relationships (e.g., `hasMany` for nested items) or a package like `nWidart/laravel-modules` for modular menu management. These avoid Doctrine/Gedmo overhead but may lack EasyAdmin integration.
How do I set up Gedmo Tree in Laravel if I want to replicate Easy Menu Bundle’s hierarchy?
Gedmo Tree isn’t natively supported in Laravel, but you can manually implement tree behavior using Eloquent relationships (e.g., `parent_id` foreign keys) or a package like `cviebrock/eloquent-sluggable`. For a closer match to Gedmo, install `gedmo/doctrine-extensions` via Composer and configure it in your `config/doctrine.php`, though this adds Symfony-like dependencies. Test performance with large datasets, as recursive queries can impact speed.
Does Easy Menu Bundle support role-based or dynamic menus in Symfony?
Yes, Easy Menu Bundle allows dynamic menu generation through EasyAdmin’s `configureMenuItems()` method, where you can conditionally yield menu items based on user roles, permissions, or other logic. For Laravel, replicate this by extending the menu service to filter items via middleware (e.g., `Auth::user()->can()`) or policy checks before rendering. Blade directives like `@can` can handle role-based visibility.
What’s the best way to migrate from Easy Menu Bundle to a Laravel-native solution?
Start by extracting the core menu logic (e.g., tree structure, item storage) from the bundle and rewriting it in Laravel using Eloquent. Replace Doctrine entities with Laravel models, swap Twig templates for Blade components, and abstract EasyAdmin-specific hooks into a service layer. Use migrations to transfer existing menu data. For testing, validate that hierarchical queries (e.g., fetching all children) work as expected in your new setup.
Will Easy Menu Bundle work with Laravel’s built-in authentication (e.g., Sanctum, Breeze) for menu access control?
No, Easy Menu Bundle is tied to Symfony’s security system. For Laravel, integrate access control by extending your menu service to check user roles/permissions using Laravel’s built-in auth (e.g., `Gate::allows()` or middleware). Pass the filtered menu items to Blade templates, where you can further restrict visibility with `@auth`, `@can`, or custom directives. Avoid coupling menu logic to Symfony’s security components.
How do I configure Easy Menu Bundle for Symfony 7.x and PHP 8.2+?
Use the `3.x` branch of Easy Menu Bundle, which explicitly supports Symfony 6.4/7.x and PHP 8.2+. Install it via Composer (`composer require agence-adeliom/easy-menu-bundle:^3.0`) and enable the bundle in `config/bundles.php`. For Gedmo Tree, ensure `stof_doctrine_extensions` is configured in `config/packages/stof_doctrine_extensions.yaml` with the correct mapping for Symfony 7’s project structure. Run migrations or schema updates afterward.
Are there performance concerns with Gedmo Tree in production for large menus?
Gedmo Tree can impact performance with deeply nested or large menus due to recursive queries. In Symfony, optimize by caching menu structures (e.g., with Symfony’s cache system) or using eager loading (`fetchChildren()` with `DQL`). In Laravel, avoid recursive queries by using Eloquent’s `with()` for nested relationships or implementing a materialized path pattern (storing full paths in a column) for faster lookups.
Can I use Easy Menu Bundle with FilamentPHP or another Laravel admin panel instead of EasyAdmin?
No, Easy Menu Bundle is tightly coupled with EasyAdmin’s `configureMenuItems()` method. For FilamentPHP or other Laravel admin panels, create a custom menu system using Eloquent models and Blade components. Filament’s built-in navigation system or packages like `spatie/laravel-menu` offer easier integration. You could theoretically abstract the bundle’s logic into a Laravel service, but this would require significant refactoring to remove EasyAdmin dependencies.
How do I test Easy Menu Bundle’s menu functionality in a Laravel-like environment?
To simulate testing, mock the bundle’s core classes (e.g., `MenuBuilder`, `MenuItem`) in PHPUnit and verify their logic works with Laravel’s DI container. For database tests, use Eloquent models with identical relationships to the bundle’s Doctrine entities. Test edge cases like empty menus, deep hierarchies, and permission-based filtering. If adapting for Laravel, write tests for your custom service layer to ensure it handles menu generation, caching, and access control as expected.
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.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware