<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
use App\Entity\Prestations;
class PrestationController extends AbstractController
{
/**
* @Route("/admin/prestation/list/{coiffeur}", name="app_prestation_list")
*/
public function listPrestationAction(int $coiffeur)
{
$repository = $this->getDoctrine()->getRepository(Prestations::class);
$prestation = $repository->findByCoiffeur($coiffeur);
return new JsonResponse($prestation);
}
}