src/Controller/PrestationController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\JsonResponse;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Entity\Prestations;
  7. class PrestationController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/admin/prestation/list/{coiffeur}", name="app_prestation_list")
  11.      */
  12.     public function listPrestationAction(int $coiffeur)
  13.     {
  14.         $repository $this->getDoctrine()->getRepository(Prestations::class);
  15.         $prestation $repository->findByCoiffeur($coiffeur);
  16.         return new JsonResponse($prestation);
  17.     }
  18. }