phil / reporting-bundle
Dashboards and reports for Symfony: metrics and series from any bundle through a data-source port, dashboards as Twig components with accessible HTML, CSS and SVG charts and a table of every value, an optional EasyAdmin page, and CSV, TSV or JSON reports scheduled with Scheduler and delivered by Mai
Package info
github.com/parler-haut-interagir-librement/reporting-bundle
Type:symfony-bundle
pkg:composer/phil/reporting-bundle
Requires
- php: >=8.5
- ext-intl: *
- ext-json: *
- ext-mbstring: *
- ext-sodium: *
- phil/svg-chart: ^0.1@dev
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/service-contracts: ^3.6
Requires (Dev)
- easycorp/easyadmin-bundle: ^5.8
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/asset-mapper: ^8.2
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/filesystem: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/mailer: ^8.2
- symfony/messenger: ^8.2
- symfony/mime: ^8.2
- symfony/notifier: ^8.2
- symfony/routing: ^8.2
- symfony/scheduler: ^8.2
- symfony/security-core: ^8.2
- symfony/stimulus-bundle: ^3.7
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-live-component: ^3.7
- symfony/ux-twig-component: ^3.7
- twig/twig: ^3.21
Suggests
- easycorp/easyadmin-bundle: To show a dashboard as a page of an EasyAdmin back office
- phil/ux-css: For the look of the dashboards, on the tokens of PHIL UX
- symfony/console: For phil:reporting:export
- symfony/http-foundation: To stream a report as a download from a controller
- symfony/mailer: To send the reports by e-mail, the file attached
- symfony/messenger: To export and deliver the reports in a worker
- symfony/notifier: To announce the reports on the channels of Notifier
- symfony/scheduler: To export and deliver the reports on a schedule
- symfony/security-core: To restrict a dashboard to a role
- symfony/ux-live-component: To change a dashboard's period without reloading the page
- symfony/ux-twig-component: For the dashboards, metrics and charts on a page
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-11 13:32:15 UTC
README
Dashboards and reports for Symfony applications: figures contributed by any bundle, charts drawn without a script, reports exported, scheduled and delivered.
phil/reporting-bundle gathers what an application measures in one place. Any bundle, or the application itself,
contributes a figure — orders taken, a renewal rate — as a MetricSource, and a series — visits by day, sales by
category — as a SeriesSource. The configuration places them on dashboards; Twig components show a dashboard, a
metric or a chart on any page, and an EasyAdmin back office shows a dashboard as one of its pages when EasyAdmin is
installed.
The charts are HTML, CSS and SVG, never a script. An SVG image is drawn on the server by phil/svg-chart, with a
title, a description that reads every value, and the table of its values beside it; bars of HTML and CSS are a table
themselves; a table alone is a third rendering. A metric shows its value written in the reader's locale, and its
change from the period before.
A report is a service with columns and rows, read row by row: exported to CSV, TSV or JSON, streamed as a download, written from the command line, or scheduled with Symfony Scheduler and delivered by Mailer or Notifier from a Messenger worker. A message carries an identifier only: the job, with its recipients and parameters, and the exported file wait in stores readable by their owner — the claim check.
It relies on the library phil/svg-chart to draw the images; Symfony UX, Messenger, Scheduler, Mailer,
Notifier, Console and EasyAdmin are each used when they are installed.
Status
| Part | State |
|---|---|
MetricSource, SeriesSource: the data-source port, found by key |
Implemented and tested |
Period, Metric, Series, SeriesSet, with limits; PeriodPreset, counted in the configured time zone |
Implemented and tested |
| Dashboards in the configuration, restricted to a role when one is named | Implemented and tested |
PhilReporting:Dashboard, :LiveDashboard, :Metric, :Chart components |
Implemented and tested |
| SVG, HTML and table renderings; a stylesheet on the tokens of PHIL UX, no inline style | Implemented and tested |
ReportDefinition, ReportFormat (CSV, TSV, JSON), formula cells neutralised, rows bounded |
Implemented and tested |
ReportQueue, RunReport, the job and export stores of the claim check |
Implemented and tested |
The phil_reporting schedule of Symfony Scheduler |
Implemented and tested |
The mail and notification deliveries |
Implemented and tested |
ReportResponses downloads, phil:reporting:export, the EasyAdmin page |
Implemented and tested |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, enabling the bundle, the stylesheet. |
| Configuration | Every key of phil_reporting. |
| Sources | Contributing metrics and series, periods and limits. |
| Dashboards | The components, the renderings, their accessibility, EasyAdmin. |
| Reports | Definitions, formats, downloads, the command, schedules, deliveries and the claim check. |
| Extension points | What an application may replace or add, and when it is stable. |
| Testing | The bundle's tests, and testing code that uses it. |
| Reference | Every public type, with its role. |
Quick start
use Phil\ReportingBundle\Application\Contract\MetricSource; use Phil\ReportingBundle\Domain\ValueObject\Metric; use Phil\ReportingBundle\Domain\ValueObject\Period; final readonly class OrdersTaken implements MetricSource { public function __construct(private OrderRepository $orders) {} public static function key(): string { return 'orders'; } public function title(): string { return 'Orders'; } public function metric(Period $period): Metric { return new Metric($this->orders->countBetween($period->start, $period->end)); } }
# config/packages/phil_reporting.yaml phil_reporting: timezone: America/Toronto dashboards: sales: title: Sales periods: [last_30_days, this_month, last_month] widgets: - { metric: orders, compare: true }
<twig:PhilReporting:LiveDashboard name="sales" />
Requirements
PHP 8.5 or later, with intl, json, mbstring and sodium; Symfony 8.2.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.