2024-11-30 20:02:59 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Controller;
|
|
|
|
|
|
|
|
use App\Entity\User;
|
2024-12-02 23:59:20 -05:00
|
|
|
use App\Libs\NavList;
|
2024-11-30 20:02:59 -05:00
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
|
|
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
|
|
|
|
|
|
|
class StaffController extends AbstractController
|
|
|
|
{
|
|
|
|
public function __construct(
|
|
|
|
private readonly EntityManagerInterface $entityManager,
|
|
|
|
private readonly UserPasswordHasherInterface $userPasswordHasher,
|
|
|
|
private array $navLinks = []
|
|
|
|
) {
|
2024-12-02 23:59:20 -05:00
|
|
|
$this->navLinks = NavList::LIST;
|
2024-11-30 20:02:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[Route('/staff-dashboard', name: 'staff')]
|
|
|
|
public function staffDashboard(#[CurrentUser()] User $user): Response
|
|
|
|
{
|
|
|
|
$this->navLinks['staff_dashboard'] = 'nav-link text-white active bg-gradient-dark';
|
|
|
|
|
|
|
|
return $this->render(
|
|
|
|
'internal/staff/staff-dashboard.html.twig',
|
|
|
|
array_merge(
|
|
|
|
$this->navLinks,
|
|
|
|
[
|
|
|
|
'breadcrumbs' => [
|
|
|
|
'Staff Dashboard'
|
|
|
|
],
|
|
|
|
'notifications' => $user->retrieveUnreadNotifications(),
|
|
|
|
]
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|