This repository has been archived on 2024-10-16. You can view files and clone it, but cannot push or open issues or pull requests.
pflaenz.li-Symfony/src/Controller/Admin/DashboardController.php
2021-05-04 11:52:20 +02:00

38 lines
1.2 KiB
PHP

<?php
namespace App\Controller\Admin;
use App\Entity\User;
use App\Entity\Offering;
use App\Entity\Wish;
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DashboardController extends AbstractDashboardController
{
/**
* @Route("/admin", name="admin")
*/
public function index(): Response
{
return parent::index();
}
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('Plant Exchange');
}
public function configureMenuItems(): iterable
{
yield MenuItem::linktoRoute('Back to the website', 'fas fa-arrow-left', 'homepage');
yield MenuItem::linktoDashboard('Dashboard', 'fa fa-home');
yield MenuItem::linkToCrud('User', 'fas fa-user', User::class);
yield MenuItem::linkToCrud('Offering', 'fas fa-seedling', Offering::class);
yield MenuItem::linkToCrud('Wish', 'fas fa-star', Wish::class);
}
}