Logfiles for sessions
This commit is contained in:
30
src/Game/Controller/GameAdminController.php
Normal file
30
src/Game/Controller/GameAdminController.php
Normal 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user