<?php
namespace Controller\App;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
class HomeController
{
/**
* @Route("/", name="homepage", methods={"GET"})
*/
public function homepage(Security $security, UrlGeneratorInterface $urlGenerator)
{
$user = $security->getUser();
$landingPage = $user->getUser()['landing_page'] ?? 'home.get.overview';
return new RedirectResponse($urlGenerator->generate($landingPage));
}
}