src/Controller/DashboardController.php line 12

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class DashboardController extends AbstractController
  7. {
  8.     #[Route('/'name'app_dashboard')]
  9.     public function index(): Response
  10.     {
  11.         if (empty($this->getUser())){
  12.             return $this->redirectToRoute('app_login');
  13.         }
  14.         if ($this->getUser()->getCode() === 'ATEL') {
  15.             return $this->redirectToRoute('packing_dashboard');
  16.         }
  17.         return $this->render('dashboard/index.html.twig', [
  18.         ]);
  19.     }
  20. }