PHPackages                             nowo-tech/dashboard-menu-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. nowo-tech/dashboard-menu-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

nowo-tech/dashboard-menu-bundle
===============================

Symfony bundle for configurable dashboard menus with i18n (JSON translations), tree structure (parent/position), permissions, Twig and JSON API. No external ORM extensions.

v0.3.40(2mo ago)0756↓36.7%[7 PRs](https://github.com/nowo-tech/DashboardMenuBundle/pulls)MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Mar 10Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/DashboardMenuBundle)[ Packagist](https://packagist.org/packages/nowo-tech/dashboard-menu-bundle)[ Docs](https://github.com/nowo-tech/dashboard-menu-bundle)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-dashboard-menu-bundle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (56)Versions (54)Used By (0)

Nowo Dashboard Menu Bundle
==========================

[](#nowo-dashboard-menu-bundle)

[![CI](https://github.com/nowo-tech/DashboardMenuBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/DashboardMenuBundle/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/53cf4e21aec6f6fe94e7078ab69724326ed52e9cad8ea19d65adeaeea10d58f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f64617368626f6172642d6d656e752d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/dashboard-menu-bundle) [![Packagist Downloads](https://camo.githubusercontent.com/b93d35a0fe50659d9e9f6a99f65b3b4d4d5f66d9205d10efd3101207a11b63dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f64617368626f6172642d6d656e752d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/dashboard-menu-bundle) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/3f99b197569aa2dcfbefff17ecc68d74098e7f929d8b52dc40f3a898f740eae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/5486f3f6ab428ddf504fcf0dc381429deaa7e60c8cf90da4aaecba241f0238e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e3425323025374325323037253230253743253230382d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/8ccbb74f2c7d21f9af007c7f184a440c1a37c1ff366f30f20808ed708844ad7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f64617368626f6172642d6d656e752d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/DashboardMenuBundle) [![Coverage](https://camo.githubusercontent.com/0fd65a2a8dbdb31f4b1e6475191deb43e725bd6a3bf7ed3d5bc831036ce0722a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d39312532352d79656c6c6f77)](#tests-and-coverage)

> ⭐ **Found this useful?** [Install from Packagist](https://packagist.org/packages/nowo-tech/dashboard-menu-bundle) · Give it a **star** on [GitHub](https://github.com/nowo-tech/DashboardMenuBundle) so more developers can find it.

**Nowo Dashboard Menu Bundle** — Configurable dashboard menus with i18n (JSON translations), tree structure (parent + position), permissions, Twig rendering and JSON API. No external ORM extensions (Gedmo/Stof). For Symfony 6.4, 7 and 8 · PHP 8.2+.

Table of contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [Demo](#demo)
- [Development](#development)
- [License &amp; author](#license--author)

Features
--------

[](#features)

- **Menu &amp; MenuItem entities**: Tree (parent/children, ordered by position), labels with optional JSON translations per locale, optional icon per item (e.g. Symfony UX Icons)
- **Context resolution**: Same `code` can have multiple menus with different JSON context (e.g. `partnerId`, `operatorId`); pass an ordered list of context sets and the first match is used; empty context = fallback
- **Config**: Doctrine connection and table prefix; cache (TTL + pool) for the menu tree; `icon_library_prefix_map` (e.g. `bootstrap-icons` → `bi`); locales; per-menu options (classes, permission checker, depth limit, icons, collapsible) in the database
- **Permissions**: `MenuPermissionCheckerInterface` — implement and tag to filter items per user/context
- **Twig**: `dashboard_menu_tree(menuCode, permissionContext?, contextSets?)`, `dashboard_menu_href(item)`, `dashboard_menu_config(menuCode, contextSets?)`; include `@NowoDashboardMenuBundle/menu.html.twig`
- **JSON API**: `GET /api/menu/{code}` for SPA consumption (optional `_locale`, `_context_sets` query params)
- **Dashboard**: CRUD at `/admin/menus` (list, create, edit, copy menu, manage items); export/import menus as JSON; optional **drag-and-drop tree reorder** (SortableJS) on a dedicated route; forms split into definition (pencil) and configuration (gear); redirect to referer after successful actions; import available in a modal
- **Performance**: Two SQL queries per menu (menu + items), optional PSR-6 cache (configurable TTL); labels by locale from JSON; tree built in PHP
- **Dev**: Web Profiler panel “Dashboard menus” (menus on page, query count, configuration tab: connection, cache, locales, icon map, permission checkers)

Installation
------------

[](#installation)

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

[![Install from Packagist](https://camo.githubusercontent.com/25ba1d8b573a14c09873ad1c973fe17a929432bcf6cf4ceca6fa0910e34c5d08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d696e7374616c6c2d3737374242343f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/nowo-tech/dashboard-menu-bundle)

With **Symfony Flex**, the recipe (if available) registers the bundle and adds config/routes. Without Flex, see [docs/INSTALLATION.md](docs/INSTALLATION.md) for manual steps.

Configuration
-------------

[](#configuration)

Menus are **defined in the database** (dashboard at `/admin/menus` or fixtures): code, name, context (optional JSON), CSS classes. In YAML you only need **defaults** (and optional **project**, **locales**). See [docs/CONFIGURATION.md](docs/CONFIGURATION.md).

```
# 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: ['es', 'en']
  api:
    enabled: true
    path_prefix: /api/menu
```

Usage
-----

[](#usage)

**Twig:**

```
{% set tree = dashboard_menu_tree('sidebar') %}
{% set config = dashboard_menu_config('sidebar') %}
{% include '@NowoDashboardMenuBundle/menu.html.twig' with { menuTree: tree, menuCode: 'sidebar', menuConfig: config } %}
```

**With context sets** (resolve which menu variant to show):

```
{% set contextSets = [{ 'partnerId': 1, 'operatorId': 1 }, { 'partnerId': 1 }, {}] %}
{% set tree = dashboard_menu_tree('sidebar', null, contextSets) %}
```

**API:** `GET /api/menu/sidebar` returns JSON tree with `label`, `href`, `routeName`, `children`. Optional query: `_context_sets` (JSON array of context objects).

Full details: [docs/USAGE.md](docs/USAGE.md).

Documentation
-------------

[](#documentation)

- [Installation](docs/INSTALLATION.md)
- [Configuration](docs/CONFIGURATION.md)
- [Usage](docs/USAGE.md)
- [Contributing](docs/CONTRIBUTING.md)
- [Changelog](docs/CHANGELOG.md)
- [Upgrading](docs/UPGRADING.md)
- [Release](docs/RELEASE.md)
- [Security](docs/SECURITY.md)
- [Engram](docs/ENGRAM.md)

### Additional documentation

[](#additional-documentation)

- [Demo with FrankenPHP (development and production)](docs/DEMO-FRANKENPHP.md)
- [Demo](docs/DEMO.md)
- [Development](docs/DEVELOPMENT.md)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2, &lt; 8.6
- Symfony 6.4 (LTS), 7.x or 8.x (^6.4 || ^7.0 || ^8.0)
- Doctrine ORM ^2.13 || ^3.0 (no Gedmo/Stof required)
- Symfony UX Autocomplete &amp; Live Component (installed with the bundle): **2.x** (from 2.32 / 2.33) or **3.x**

See [docs/INSTALLATION.md](docs/INSTALLATION.md#requirements) and [docs/UPGRADING.md](docs/UPGRADING.md) for compatibility notes.

Demo
----

[](#demo)

Demos (**Symfony 7** and **8** only in this repo; the bundle also supports **Symfony 6.4** via Composer) are in `demo/symfony7` and `demo/symfony8`. Each uses **FrankenPHP** with **Caddy** (HTTP on port 80 in the container). **`docker-compose`** defaults to **`APP_ENV=dev`**, so the entrypoint uses **Caddyfile.dev** (no PHP worker) so Twig/PHP changes show on refresh. **Worker mode** applies to a production-style Caddyfile — [docs/DEMO-FRANKENPHP.md](docs/DEMO-FRANKENPHP.md). Quick start: [docs/DEMO.md](docs/DEMO.md).

Default host ports: **8010** (symfony7), **8011** (symfony8) via `PORT` in each demo’s `.env`.

From bundle root:

```
make -C demo/symfony8 up
make -C demo/symfony8 install
# Open http://localhost:8011 (symfony8) or http://localhost:8010 (symfony7), unless PORT is overridden
```

Development
-----------

[](#development)

Run tests and QA with Docker: `make up && make install && make test` (or `make test-coverage`, `make qa`). Without Docker: `composer install && composer test`. Full details: [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).

**Dashboard assets (TS → JS):** Built with **Vite** (as in [IconSelectorBundle](https://github.com/nowo-tech/icon-selector-bundle)). Sources under `src/Resources/assets/src/` (dashboard.ts, stimulus-live.ts, logger.ts). Output: `src/Resources/public/js/dashboard.js` (IIFE) and `js/stimulus-live.js` (ESM), installed by Symfony to `public/bundles/nowodashboardmenu/js/`.

```
pnpm install
pnpm run build    # production build (dashboard.js + stimulus-live.js)
pnpm run dev     # watch dashboard.js
pnpm run build:dashboard    # only dashboard.js
pnpm run build:stimulus-live  # only stimulus-live.js
```

Then run `php bin/console assets:install` in the app so `public/bundles/nowodashboardmenu/js/` is updated.

Tests and coverage
------------------

[](#tests-and-coverage)

- Tests: PHPUnit (unit and integration suites)
- PHP (Lines): **91.04%** (full `src/` per PHPUnit summary; main gaps: dashboard controller branches, repository persistence helpers). Run `composer test-coverage` for the current Summary.
- TS/JS: N/A (bundle ships built assets; optional local `pnpm run build` or `make assets` for contributors)
- Python: N/A

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

Author
------

[](#author)

Created by [Héctor Franco Aceituno](https://github.com/HecFranco) at [Nowo.tech](https://nowo.tech)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

43

Last Release

70d ago

PHP version history (3 changes)0.0.1PHP &gt;=8.2 &lt;8.6

v0.2.0PHP &gt;=8.4 &lt;8.6

v0.3.34PHP &gt;=8.1 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7947bfc3f2ce9574a18a2c60f3d95b5d1b0740e65dc929332c92f1df21f75ab?d=identicon)[HecFranco](/maintainers/HecFranco)

---

Top Contributors

[![HecFranco](https://avatars.githubusercontent.com/u/24323276?v=4)](https://github.com/HecFranco "HecFranco (133 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (36 commits)")

---

Tags

jsonapisymfonytwigdoctrinetreemenudashboardnavigationSymfony Bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nowo-tech-dashboard-menu-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nowo-tech-dashboard-menu-bundle/health.svg)](https://phpackages.com/packages/nowo-tech-dashboard-menu-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M374](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[contao/core-bundle

Contao Open Source CMS

1231.6M2.7k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
