Logfiles for sessions

This commit is contained in:
Frank
2026-01-08 18:14:56 +01:00
parent a475c1a268
commit 50d7ce745c
8 changed files with 277 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace App\Game\Controller;
use App\Game\Repository\SessionRepository;
use App\Tech\Repository\UserRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
#[Route('/admin')]
#[IsGranted('ROLE_ADMIN')]
final class GameAdminController extends AbstractController
{
#[Route('', name: 'game_admin_dashboard', methods: ['GET'])]
public function index(
UserRepository $userRepository,
SessionRepository $sessionRepository
): Response {
$players = $userRepository->findByRole('ROLE_PLAYER');
$sessions = $sessionRepository->findAll();
return $this->render('game/admin/index.html.twig', [
'players' => $players,
'sessions' => $sessions,
]);
}
}