Skip to main content

Requirements

RequirementVersion
PHP>= 8.2, < 8.6
Symfony6.4 (LTS), 7.x, or 8.x
Doctrine ORM^2.13 || ^3.0
1

Install via Composer

composer require nowo-tech/dashboard-menu-bundle
2

Register the bundle

If you use Symfony Flex, the recipe handles registration automatically:
  • Adds the bundle to config/bundles.php
  • Creates config/packages/nowo_dashboard_menu.yaml with default config
  • Creates config/routes_nowo_dashboard_menu.yaml with prefixed dashboard routes
No manual edits required. Continue to the Import routes step to verify or adjust the route configuration.
3

Import routes

Import the bundle routes in config/routes.yaml so the API and dashboard are reachable.
# config/routes.yaml
nowo_dashboard_menu:
    resource: '@NowoDashboardMenuBundle/Resources/config/routes.yaml'

_nowo_dashboard_menu_dashboard:
    resource: routes_nowo_dashboard_menu.yaml
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.
4

Add package configuration

Create config/packages/nowo_dashboard_menu.yaml. The minimal required keys are doctrine and api:
config/packages/nowo_dashboard_menu.yaml
nowo_dashboard_menu:
    project: my_app
    doctrine:
        connection: default
        table_prefix: ''
    cache:
        ttl: 60
        pool: cache.app
    icon_library_prefix_map:
        bootstrap-icons: bi
    locales: ['en', 'es']
    api:
        enabled: true
        path_prefix: /api/menu
With Symfony Flex, this file is created for you with sensible defaults. You only need to adjust values that differ from your project setup.
5

Generate and run the migration

Use the bundle’s console command to generate a migration that matches your doctrine connection and table_prefix config:
php bin/console nowo_dashboard_menu:generate-migration
php bin/console doctrine:migrations:migrate
If you use a non-default Doctrine connection, pass it explicitly to the migrate command:
php bin/console doctrine:migrations:migrate --conn=YOUR_CONNECTION
The nowo_dashboard_menu:generate-migration command is recommended over doctrine:schema:update --force because it respects your configured connection and table prefix.
6

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/sidebar and confirm you receive a JSON response.