<?php
namespace App\Controller\Admin\Home;
//use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use App\Entity\Customer\Customer;
use App\Entity\Invoice\Invoice;
class HomeController extends AbstractController
{
public function index()
{
$em = $this->getDoctrine()->getManager();
$customers = $em->getRepository(Customer::class)->findBy([], ['id'=>'DESC'], 5, 0);
$invoices = $em->getRepository(Invoice::class)->findBy([], ['id'=>'DESC'], 5, 0);
return $this->render('admin/home/index.html.twig', [
'customers' => $customers,
'invoices' => $invoices
]);
}
}