public function addAdminMenuItem(MenuCollectionEvent $event): void
    {
        if (!$this->auth->isGranted('ROLE_ADMIN')) {
            return;
        }

        $menu = $event->getMenu();

        // Create admin menu item.
        $admin = $this->factory->createItem('menu_item.admin', [
            'route' => 'bkstg_admin_redirect',
            'extras' => [
                'icon' => 'wrench',
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($admin);
    }
public function addAdminMenuItem(MenuCollectionEvent $event): void
    {
        if (!$this->auth->isGranted('ROLE_ADMIN')) {
            return;
        }

        $menu = $event->getMenu();

        // Create admin menu item.
        $admin = $this->factory->createItem('menu_item.admin', [
            'route' => 'bkstg_admin_redirect',
            'extras' => [
                'icon' => 'wrench',
                'translation_domain' => BkstgCoreBundle::TRANSLATION_DOMAIN,
            ],
        ]);
        $menu->addChild($admin);
    }
public function addAdminMenuItem ( MenuCollectionEvent $ event ) : void { if ( ! $ this -> auth -> isGranted ( 'ROLE_ADMIN' ) ) { return ; } $ menu = $ event -> getMenu ( ) ; // Create admin menu item. $ admin = $ this -> factory -> createItem ( 'menu_item.admin' , [ 'route' => 'bkstg_admin_redirect' , 'extras' => [ 'icon' => 'wrench' , 'translation_domain' => BkstgCoreBundle :: TRANSLATION_DOMAIN , ] , ] ) ; $ menu -> addChild ( $ admin ) ; }
Add the admin menu item.

@param MenuCollectionEvent $event The menu collection event.

@return void
Add the admin menu item .