<?php
namespace App\Controller\Dashboard;
use App\Service\NavigationService;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class DashboardController extends AbstractController
{
/**
* @Route("/", name="app_home")
* @Route("/dashboard", name="app_index")
* @param NavigationService $navigationService
* @return Response
*/
public function index(NavigationService $navigationService): Response
{
if (!$this->isGranted('ROLE_USER')) {
return $this->redirect('/login');
}
return $this->render('dashboard/default.html.twig', [
'navigation' => $navigationService->getJson()
]);
}
}