<?php
namespace App\Controller;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class AppController extends AbstractController
{
public function __construct()
{
}
#[Route('/', name: 'home')]
public function home(): Response
{
if ($this->isGranted('ROLE_ADMIN')) {
return $this->redirectToRoute('tools_home');
}
if ($this->isGranted('ROLE_CLUB_MANAGER')) {
return $this->redirectToRoute('bo_home');
}
return $this->redirectToRoute('app_logout');
}
}