navLinks = NavList::LIST; } #[Route('/dashboard', name: 'app_dashboard')] public function dashboard(Request $request, #[CurrentUser()] ?User $user): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); $this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user); $this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user); if (!$user->getCompany()) { return $this->redirectToRoute('app_register_step', ['step' => RegistrationController::REGISTER_STEP_TWO]); } $this->navLinks['user_dashboard'] = NavList::PRESENT_LINK; return $this->render( 'internal/dashboard.html.twig', array_merge( $this->navLinks, [ 'breadcrumbs' => [ new Breadcrumb('', 'Dashboard') ], 'notifications' => $this->msgs, 'notificationCount' => $this->notificationCount, ] ) ); } #[Route('/profile', name: 'app_profile')] public function profile(#[CurrentUser()] User $user): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY'); $this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user); $this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user); $this->navLinks['profile'] = NavList::PRESENT_LINK; return $this->render( 'internal/profile.html.twig', array_merge( $this->navLinks, [ 'breadcrumbs' => [ new Breadcrumb('', 'Profile') ], 'notifications' => $this->msgs, 'notificationCount' => $this->notificationCount, ] ) ); } }