2017 © Pedro Peláez
 

symfony-bundle easyadmindashboard-bundle

Dashboard/Homepage page for EasyAdminBundle

image

easyadminfriends/easyadmindashboard-bundle

Dashboard/Homepage page for EasyAdminBundle

  • Friday, June 15, 2018
  • by anybug
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 78 % Grown

The README.md

EasyAdminDashboardBundle

This bundle is an extension for the Easycorp EasyAdminBundle (the simple Symfony backends administration bundle). It allows you to create easily a user-friendly homepage with some counters, like a dashboard., (*1)

Alt text, (*2)

Requirements

This bundle requires, in addition to prerequisites of each PHPOffice library:, (*3)

* PHP 8.0 or higher
* Symfony 5.3 or higher
* EasyAdmin 3 or 4

Installation

Use composer to require the latest stable version., (*4)

$ composer require easyadminfriends/easyadmindashboard-bundle:2.x

Enable the bundle in your config/bundles.php file., (*5)

return [
    [...]
    EasyAdminFriends\EasyAdminDashboardBundle\EasyAdminDashboardBundle::class => ['all' => true],
];

Add Dashboard service :, (*6)

#config/services.yaml
services:

    EasyAdminFriends\EasyAdminDashboardBundle\Controller\DefaultController:
        public: true
        tags: ['doctrine']

Generate dashboard items inside Easyadmin Dashboard Controller, (*7)

#App\Controller\Admin\DashboardController
...
use EasyAdminFriends\EasyAdminDashboardBundle\Controller\DefaultController as EasyAdminDashboard;

class DashboardController extends AbstractDashboardController
{
    private $easyAdminDashboard;

    public function __construct(EasyAdminDashboard $easyAdminDashboard)
    {
        $this->easyAdminDashboard = $easyAdminDashboard;
    }

    public function index(): Response
    {
        return $this->render('@EasyAdminDashboard/Default/index.html.twig', array(
            'dashboard' => $this->easyAdminDashboard->generateDashboardValues(),
            'layout_template_path' => $this->easyAdminDashboard->getLayoutTemplate()
        ));
    }

    public function configureCrud(): Crud
    {
        ...
    }
...

Usage

documentation in progress full example:, (*8)

#config/packages/easy_admin_dashboard.yaml

parameters:
  easy_admin_dashboard:
    title: "Welcome to backend"
    blocks:
      Bloc1:
        label: Products
        size: 12
        css_class: primary
        permissions: ['ROLE_USER']
        items:
          Product:
            label: "Active products in catalog"
            size: 3
            css_class: success text-dark
        class: App\Entity\Product
            controller: App\Controller\Admin\ProductCrudController
            icon:  shopping-cart
            link_label: "Product list"
            permissions: ['ROLE_ADMIN']
        query: MyCustomQuery
          ProductCategory:
            label: "Categories"
            size: 3
            css_class: green
            class: App\Entity\Category
            controller: App\Controller\Admin\ProductCategoryCrudController
            icon:  list-ul
            link_label: "Category list"
        permissions: ['ROLE_ADMIN']
        dql_filter: "entity.is_active = 1"

Roadmap and Contributions

Contributions are more than welcome. Fork the project, and submit a PR when you're done., (*9)

Remaining todos include:, (*10)

  • Tests coverage
  • Improved documentation

The Versions

15/06 2018

dev-master

9999999-dev https://github.com/anybug/EasyAdminDashboardBundle

Dashboard/Homepage page for EasyAdminBundle

  Sources   Download

MIT

The Requires

 

by Avatar anybug

dashboard easyadmin

15/06 2018

v1.0.2

1.0.2.0 https://github.com/anybug/EasyAdminDashboardBundle

Dashboard/Homepage page for EasyAdminBundle

  Sources   Download

MIT

The Requires

 

by Avatar anybug

dashboard easyadmin

11/04 2018

v1.0.1

1.0.1.0 https://github.com/anybug/EasyAdminDashboardBundle

Dashboard/Homepage page for EasyAdminBundle

  Sources   Download

MIT

The Requires

 

by Avatar anybug

dashboard easyadmin

10/04 2018

v1.0

1.0.0.0 https://github.com/anybug/EasyAdminDashboardBundle

Dashboard/Homepage page for EasyAdminBundle

  Sources   Download

MIT

The Requires

 

by Avatar anybug

dashboard easyadmin