feat: admin dashboard widgets
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Dashboard\DashboardWidgetRegistry;
|
||||
use App\Security\Voter\AdministrativeAccessVoter;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -13,9 +14,16 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
#[IsGranted(AdministrativeAccessVoter::ADMINISTRATIVE_ACCESS)]
|
||||
class DashboardController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DashboardWidgetRegistry $widgetRegistry,
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/admin/dashboard', name: 'app_admin_dashboard')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('admin/dashboard.html.twig');
|
||||
return $this->render('admin/dashboard.html.twig', [
|
||||
'widgets' => $this->widgetRegistry->build(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user