src/Controller/Home/IndexController.php line 32

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controller\Home;
  4. use App\Entity\Security\Manager;
  5. use App\Entity\Security\ShopManager;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Response;
  8. class IndexController extends AbstractController
  9. {
  10.     public function index(): Response
  11.     {
  12.         $user $this->getUser();
  13.         if ($user instanceof Manager) {
  14.             return $this->redirectToRoute('foxorders_franchise_dashboard', ['id' => $user->getFranchise()->getId()]);
  15.         }
  16.         if ($user instanceof ShopManager) {
  17.             return $this->redirectToRoute('foxorders_shop_dashboard', ['id' => $user->getShop()->getId()]);
  18.         }
  19.         if ($this->isGranted('ROLE_SUPPORT')) {
  20.             return $this->redirectToRoute('foxorders_admin_dashboard');
  21.         }
  22.         return $this->redirectToRoute('foxorders_dashboard');
  23.     }
  24.     public function home(): Response
  25.     {
  26.         return $this->redirectToRoute('foxorders_dashboard');
  27.     }
  28.     public function Legal_notice(): Response
  29.     {
  30.         return $this->renderForm('Home/legal_notice.html.twig');
  31.     }
  32. }