clone of github.com/decent-newsroom/newsroom
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
742 B

<?php
declare(strict_types=1);
namespace App\Controller\Administration;
use App\Repository\VisitRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class VisitorAnalyticsController extends AbstractController
{
#[Route('/admin/analytics', name: 'admin_analytics')]
#[IsGranted('ROLE_ADMIN')]
public function index(VisitRepository $visitRepository): Response
{
$visitStats = $visitRepository->getVisitCountByRoute();
return $this->render('admin/analytics.html.twig', [
'visitStats' => $visitStats,
]);
}
}