<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
/**
* @Route("/", name="home")
*/
public function index(): Response
{
if( $this->isGranted('ROLE_ADMIN') || $this->isGranted('ROLE_SALARIE') ) {
return $this->redirectToRoute("crm.tdb");
} elseif( $this->isGranted('ROLE_USER') )
{
return $this->redirectToRoute("dashboard.tdb");
} elseif( $this->isGranted('ROLE_PRESTA') )
{
return $this->redirectToRoute("prestataires.tdb");
} else {
return $this->redirectToRoute("login");
}
}
}