public function build(MenuEntry $root)
    {
        // Top level header for ContentTypes
        $contentRoot = $root->add(
            MenuEntry::create('content', '')
                ->setLabel(Trans::__('general.phrase.content'))
                ->setIcon('fa:file-text')
                ->setPermission('dashboard')
        );
        $mainContentRoot = $contentRoot->add(
            MenuEntry::create('main')
                ->setPermission('dashboard')
        );

        foreach ($this->contentTypes as $name => $contentType) {
            if ($contentType->get('show_in_menu') !== true) {
                $this->addGroupedMenu($mainContentRoot, $contentType);
            } else {
                $this->addContentType($mainContentRoot, $name, $contentType);
            }
        }

        $this->fillGroupedMenus($mainContentRoot);

        return $root;
    }
public function build(MenuEntry $root)
    {
        // Top level header for ContentTypes
        $contentRoot = $root->add(
            MenuEntry::create('content', '')
                ->setLabel(Trans::__('general.phrase.content'))
                ->setIcon('fa:file-text')
                ->setPermission('dashboard')
        );
        $mainContentRoot = $contentRoot->add(
            MenuEntry::create('main')
                ->setPermission('dashboard')
        );

        foreach ($this->contentTypes as $name => $contentType) {
            if ($contentType->get('show_in_menu') !== true) {
                $this->addGroupedMenu($mainContentRoot, $contentType);
            } else {
                $this->addContentType($mainContentRoot, $name, $contentType);
            }
        }

        $this->fillGroupedMenus($mainContentRoot);

        return $root;
    }
public function build ( MenuEntry $ root ) { // Top level header for ContentTypes $ contentRoot = $ root -> add ( MenuEntry :: create ( 'content' , '' ) -> setLabel ( Trans :: __ ( 'general.phrase.content' ) ) -> setIcon ( 'fa:file-text' ) -> setPermission ( 'dashboard' ) ) ; $ mainContentRoot = $ contentRoot -> add ( MenuEntry :: create ( 'main' ) -> setPermission ( 'dashboard' ) ) ; foreach ( $ this -> contentTypes as $ name => $ contentType ) { if ( $ contentType -> get ( 'show_in_menu' ) !== true ) { $ this -> addGroupedMenu ( $ mainContentRoot , $ contentType ) ; } else { $ this -> addContentType ( $ mainContentRoot , $ name , $ contentType ) ; } } $ this -> fillGroupedMenus ( $ mainContentRoot ) ; return $ root ; }
Build the "Content" menu.

@param MenuEntry $root

@return MenuEntry
Build the Content menu .