Requirements
| Requirement | Version |
|---|---|
| PHP | >= 8.2, < 8.6 |
| Symfony | 6.4 (LTS), 7.x, or 8.x |
| Doctrine ORM | ^2.13 || ^3.0 |
Register the bundle
- With Symfony Flex
- Manual (without Flex)
If you use Symfony Flex, the recipe handles registration automatically:
- Adds the bundle to
config/bundles.php - Creates
config/packages/nowo_dashboard_menu.yamlwith default config - Creates
config/routes_nowo_dashboard_menu.yamlwith prefixed dashboard routes
Import routes
Import the bundle routes in
config/routes.yaml so the API and dashboard are reachable.With Symfony Flex,
config/routes_nowo_dashboard_menu.yaml is created automatically and imports @NowoDashboardMenuBundle/Resources/config/routes_dashboard.yaml with prefix: /admin/menus. Without Flex, create that file manually with the prefix of your choice. The dashboard URL prefix is configured only in routing — not in nowo_dashboard_menu.yaml.Add package configuration
Create
config/packages/nowo_dashboard_menu.yaml. The minimal required keys are doctrine and api:config/packages/nowo_dashboard_menu.yaml
Generate and run the migration
Use the bundle’s console command to generate a migration that matches your The
doctrine connection and table_prefix config:If you use a non-default Doctrine connection, pass it explicitly to the migrate command:
nowo_dashboard_menu:generate-migration command is recommended over doctrine:schema:update --force because it respects your configured connection and table prefix.Verify the installation
Confirm that everything is wired up correctly:
- Dashboard — open
/admin/menus(or your configured prefix) in a browser. You should see an empty menu list. - Twig — add
dashboard_menu_tree('sidebar')to a template and include@NowoDashboardMenuBundle/menu.html.twig(see Quickstart). - JSON API — call
GET /api/menu/sidebarand confirm you receive a JSON response.