<?php
namespace App\Controller\Admin;
use App\Entity\User;
use App\Entity\Event;
use App\Entity\Tyres;
use App\Entity\Company;
use App\Entity\UseType;
use App\Entity\Invoice;
use App\Entity\Vehicle;
use App\Entity\FuelType;
use App\Entity\EventType;
use App\Entity\VehicleKind;
use App\Entity\CompanyGroup;
use App\Entity\Notification;
use App\Entity\VehicleStatus;
use App\Entity\NotificationCategory;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
class DashboardController extends AbstractDashboardController
{
/**
* @Route("/", name="admin")
*/
public function index(): Response
{
return parent::index();
}
public function configureDashboard(): Dashboard
{
return Dashboard::new()
// the name visible to end users
->setTitle('FLOTA ABS')
// the path defined in this method is passed to the Twig asset() function
->setFaviconPath('favicon.svg')
// set this option if you prefer the page content to span the entire
// browser width, instead of the default design which sets a max width
->renderContentMaximized()
// set this option if you prefer the sidebar (which contains the main menu)
// to be displayed as a narrow column instead of the default expanded design
//->renderSidebarMinimized()
// by default, all backend URLs include a signature hash. If a user changes any
// query parameter (to "hack" the backend) the signature won't match and EasyAdmin
// triggers an error. If this causes any issue in your backend, call this method
// to disable this feature and remove all URL signature checks
//->disableUrlSignatures()
// by default, all backend URLs are generated as absolute URLs. If you
// need to generate relative URLs instead, call this method
->generateRelativeUrls()
;
}
public function configureMenuItems(): iterable
{
return [
MenuItem::linkToDashboard('Dashboard', 'fa fa-home'),
MenuItem::section('Firmy'),
MenuItem::linkToCrud('Grupy', 'fa fa-tags', CompanyGroup::class),
MenuItem::linkToCrud('Firmy', 'fa fa-file-text', Company::class),
MenuItem::section('Flota'),
MenuItem::linkToCrud('Samochody', 'fa fa-user', Vehicle::class),
MenuItem::section('Zdarzenia'),
MenuItem::linkToCrud('Zdarzenia', 'fa fa-user', Event::class),
MenuItem::section('Faktury'),
MenuItem::linkToCrud('Faktury', 'fa fa-file-invoice', Invoice::class),
MenuItem::section('Administracja'),
MenuItem::linkToCrud('Użytkownicy', 'fa fa-comment', User::class),
MenuItem::linkToCrud('Rodzaj zdarzenia', 'fa fa-comment', EventType::class),
MenuItem::linkToCrud('Rodzaje paliwa', 'fa fa-comment', FuelType::class),
MenuItem::linkToCrud('Rodzaje opon', 'fa fa-user', Tyres::class),
MenuItem::linkToCrud('Własność', 'fa fa-user', UseType::class),
MenuItem::linkToCrud('Rodzaj samochodu', 'fa fa-user', VehicleKind::class),
MenuItem::linkToCrud('Status samochodu', 'fa fa-user', VehicleStatus::class),
MenuItem::linkToCrud('Powiadomienia', 'fa fa-user', Notification::class),
MenuItem::linkToCrud('Rodzaje powiadomień', 'fa fa-user', NotificationCategory::class),
MenuItem::linkToLogout('Logout', 'fa fa-exit'),
];
}
}