<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\SiteRepository;
use App\Repository\RedirectRuleRepository;
class DashboardController extends AbstractController
{
public function __construct(
private SiteRepository $siteRepository,
private RedirectRuleRepository $ruleRepository,
) {
}
#[Route('/', name: 'home')]
public function home(): Response
{
// home is just going to forward to dashboard, this is not a "public facing" website
return $this->redirectToRoute('dashboard');
}
#[Route('/dashboard', name: 'dashboard')]
public function index(): Response
{
return $this->render('dashboard/index.html.twig', [
'sites' => $this->siteRepository->findAllowedSites($this->getUser())
]);
}
}