src/PHPDish/Bundle/WebBundle/Controller/DefaultController.php
public function countNotificationAction()
    {
        $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
        $count = $this->get('phpdish_notification.manager.notification')->getNotificationCount($this->getUser(), false);
        $nbMessageCount = $this->get('fos_message.provider')->getNbUnreadMessages();
        return $this->json([
            'count' => $count + $nbMessageCount,
        ]);
    }
public function countNotificationAction()
    {
        $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
        $count = $this->get('phpdish_notification.manager.notification')->getNotificationCount($this->getUser(), false);
        $nbMessageCount = $this->get('fos_message.provider')->getNbUnreadMessages();
        return $this->json([
            'count' => $count + $nbMessageCount,
        ]);
    }
当前用户的通知数量.

@Route("/notifications/count", name="notification_count")