wip: extend model, admin crud

This commit is contained in:
Björn Fromme committed 2026-07-16 09:03:42 +02:00
1 parent 3ae30899ea
commit a294d1cc5e
38 files changed
+1240 -830

No files matched your search

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Controller\Admin\Log;
use App\Repository\LogEntryRepository;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class IndexController extends AbstractController
{
public function __construct(
private readonly LogEntryRepository $logEntryRepository,
private readonly PaginatorInterface $paginator,
) {
}
#[Route('/admin/log', name: 'app_admin_log')]
public function index(Request $request): Response
{
$qb = $this
->logEntryRepository
->createQueryBuilder('log_entry')
;
$pagination = $this->paginator->paginate(
$qb,
$request->query->getInt('page', 1),
$request->query->getInt('limit', 50),
[
'defaultSortFieldName' => 'log_entry.createdAt',
'defaultSortDirection' => 'DESC',
]
);
return $this->render('admin/log/index.html.twig', [
'pagination' => $pagination,
]);
}
}