EventSubscriber/ProductionMenuSubscriber.php
public function addNoticeBoardItem(ProductionMenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();
        $group = $event->getGroup();

        // Create notice_board menu item.
        $board = $this->factory->createItem('menu_item.notice_board', [
            'route' => 'bkstg_board_show',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'comment',
                'translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($board);

        // If this user is an editor create the post and archive items.
        if ($this->auth->isGranted('GROUP_ROLE_EDITOR', $group)) {
            $posts = $this->factory->createItem('menu_item.notice_board_posts', [
                'route' => 'bkstg_board_show',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN],
            ]);
            $board->addChild($posts);

            $archive = $this->factory->createItem('menu_item.notice_board_archive', [
                'route' => 'bkstg_board_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN],
            ]);
            $board->addChild($archive);
        }
    }
public function addNoticeBoardItem(ProductionMenuCollectionEvent $event): void
    {
        $menu = $event->getMenu();
        $group = $event->getGroup();

        // Create notice_board menu item.
        $board = $this->factory->createItem('menu_item.notice_board', [
            'route' => 'bkstg_board_show',
            'routeParameters' => ['production_slug' => $group->getSlug()],
            'extras' => [
                'icon' => 'comment',
                'translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($board);

        // If this user is an editor create the post and archive items.
        if ($this->auth->isGranted('GROUP_ROLE_EDITOR', $group)) {
            $posts = $this->factory->createItem('menu_item.notice_board_posts', [
                'route' => 'bkstg_board_show',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN],
            ]);
            $board->addChild($posts);

            $archive = $this->factory->createItem('menu_item.notice_board_archive', [
                'route' => 'bkstg_board_archive',
                'routeParameters' => ['production_slug' => $group->getSlug()],
                'extras' => ['translation_domain' => BkstgNoticeBoardBundle::TRANSLATION_DOMAIN],
            ]);
            $board->addChild($archive);
        }
    }
Add the notice board menu item.

@param ProductionMenuCollectionEvent $event The menu collection event.

@return void