Skip to content

Dashboard bundle

Introduction

With the DashboardBundle you can create a dashboard. The dashboard provides an overview of all relevant information at one glance. To accomplish this, different widgets are used. The default widget type is number. It shows, for example, the total amount of articles written, or only the amount of published articles.

To retrieve the right value, providers are used. To get a total number, use the total provider. If you want to use your own repository method, use the repository provider instead.

You have complete freedom by writing your own widgets and providers.

Curious how that works? Find out in the next pages.

Installation

bash
$ composer require enhavo/dashboard-bundle
bash
$ yarn add @enhavo/dashboard
js
// import
const DashboardPackage = require('@enhavo/dashboard/Encore/EncoreRegistryPackage');

// register package
.register(new DashboardPackage())

Update your config/packages/enhavo.yaml

yaml
enhavo_app:
    menu:
      dashboard:
          type: dashboard

Usage

In the following you see an example on how widgets are configured in enhavo:

yaml
enhavo_dashboard:
    widgets:
        article_number:
            type: number
            label: Total Articles
            provider:
                type: total
                repository: enhavo_article.repository.article

In the example above, the widget key is article_number. The widget type is number (you could use any other widget type as well). You can configure the label shown with the label attribute.

To configure the provider, add the type and all necessary options.

See all possible options in our reference.