src/Controller/Admin/DashboardController.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Admin;
  3. use App\Entity\User;
  4. use App\Entity\Event;
  5. use App\Entity\Tyres;
  6. use App\Entity\Company;
  7. use App\Entity\UseType;
  8. use App\Entity\Invoice;
  9. use App\Entity\Vehicle;
  10. use App\Entity\FuelType;
  11. use App\Entity\EventType;
  12. use App\Entity\VehicleKind;
  13. use App\Entity\CompanyGroup;
  14. use App\Entity\Notification;
  15. use App\Entity\VehicleStatus;
  16. use App\Entity\NotificationCategory;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Symfony\Component\Routing\Annotation\Route;
  19. use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
  20. use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
  21. use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
  22. class DashboardController extends AbstractDashboardController
  23. {
  24.     /**
  25.      * @Route("/", name="admin")
  26.      */
  27.     public function index(): Response
  28.     {
  29.         return parent::index();
  30.     }
  31.     public function configureDashboard(): Dashboard
  32.     {
  33.         return Dashboard::new()
  34.             // the name visible to end users
  35.             ->setTitle('FLOTA ABS')
  36.            
  37.             // the path defined in this method is passed to the Twig asset() function
  38.             ->setFaviconPath('favicon.svg')
  39.             // set this option if you prefer the page content to span the entire
  40.             // browser width, instead of the default design which sets a max width
  41.             ->renderContentMaximized()
  42.             // set this option if you prefer the sidebar (which contains the main menu)
  43.             // to be displayed as a narrow column instead of the default expanded design
  44.             //->renderSidebarMinimized()
  45.             // by default, all backend URLs include a signature hash. If a user changes any
  46.             // query parameter (to "hack" the backend) the signature won't match and EasyAdmin
  47.             // triggers an error. If this causes any issue in your backend, call this method
  48.             // to disable this feature and remove all URL signature checks
  49.             //->disableUrlSignatures()
  50.             // by default, all backend URLs are generated as absolute URLs. If you
  51.             // need to generate relative URLs instead, call this method
  52.             ->generateRelativeUrls()
  53.         ;
  54.     }
  55.     public function configureMenuItems(): iterable
  56.     {
  57.         return [
  58.             MenuItem::linkToDashboard('Dashboard''fa fa-home'),
  59.             MenuItem::section('Firmy'),
  60.             MenuItem::linkToCrud('Grupy''fa fa-tags'CompanyGroup::class),
  61.             MenuItem::linkToCrud('Firmy''fa fa-file-text'Company::class),
  62.             MenuItem::section('Flota'),
  63.             MenuItem::linkToCrud('Samochody''fa fa-user'Vehicle::class),
  64.             MenuItem::section('Zdarzenia'),
  65.            
  66.             MenuItem::linkToCrud('Zdarzenia''fa fa-user'Event::class),
  67.             MenuItem::section('Faktury'),
  68.             MenuItem::linkToCrud('Faktury''fa fa-file-invoice'Invoice::class),
  69.             MenuItem::section('Administracja'),
  70.             MenuItem::linkToCrud('Użytkownicy''fa fa-comment'User::class),
  71.             MenuItem::linkToCrud('Rodzaj zdarzenia''fa fa-comment'EventType::class),
  72.             MenuItem::linkToCrud('Rodzaje paliwa''fa fa-comment'FuelType::class),
  73.             MenuItem::linkToCrud('Rodzaje opon''fa fa-user'Tyres::class),
  74.             MenuItem::linkToCrud('Własność''fa fa-user'UseType::class),
  75.             MenuItem::linkToCrud('Rodzaj samochodu''fa fa-user'VehicleKind::class),
  76.             MenuItem::linkToCrud('Status samochodu''fa fa-user'VehicleStatus::class),
  77.             MenuItem::linkToCrud('Powiadomienia''fa fa-user'Notification::class),
  78.             MenuItem::linkToCrud('Rodzaje powiadomień''fa fa-user'NotificationCategory::class),
  79.          
  80.             MenuItem::linkToLogout('Logout''fa fa-exit'),
  81.             
  82.         ];
  83.     }
  84. }