share(function (PhraseaApplication $app) { return (new UserNotificationController($app)); }); } public function boot(Application $app) { // no-op } /** * {@inheritDoc} */ public function connect(Application $app) { $controllers = $this->createAuthenticatedCollection($app); $firewall = $this->getFirewall($app); $controllers->before(function () use ($firewall) { $firewall->requireNotGuest(); }); $controllers->get('/', 'controller.user.notifications:listNotifications') ->bind('get_notifications'); $controllers->post('/read/', 'controller.user.notifications:readNotifications') ->bind('set_notifications_readed'); return $controllers; } }