<?php
namespace App\Controller;
use App\Entity\Customer;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
class DashboardController extends AdminController
{
/**
* @Route("/admin/dashboard", name="user_dashboard")
*/
public function userDashboard(Request $request)
{
return $this->render('admin/dashboard.html.twig', [
'entity' => $this->security->getUser(),
'users' => count($this->get('doctrine')->getRepository(Customer::class)->findAll())
]);
}
}