protected function generateMenu($menuBuilder, $menu)
    {
        $subMenu = $this->registerMenu($menuBuilder, $menu);
        $menu->children->each(function (Menu $subItem) use ($subMenu) {
            $subMenuChild = $this->registerMenu($subMenu, $subItem);
            if (count($subItem->children)) {
                $this->generateMenu($subMenuChild, $subItem);
            }
        });
    }
protected function generateMenu($menuBuilder, $menu)
    {
        $subMenu = $this->registerMenu($menuBuilder, $menu);
        $menu->children->each(function (Menu $subItem) use ($subMenu) {
            $subMenuChild = $this->registerMenu($subMenu, $subItem);
            if (count($subItem->children)) {
                $this->generateMenu($subMenuChild, $subItem);
            }
        });
    }
protected function generateMenu ( $ menuBuilder , $ menu ) { $ subMenu = $ this -> registerMenu ( $ menuBuilder , $ menu ) ; $ menu -> children -> each ( function ( Menu $ subItem ) use ( $ subMenu ) { $ subMenuChild = $ this -> registerMenu ( $ subMenu , $ subItem ) ; if ( count ( $ subItem -> children ) ) { $ this -> generateMenu ( $ subMenuChild , $ subItem ) ; } } ) ; }
Generate the menu.

@param \Caffeinated\Menus\Builder|\Caffeinated\Menus\Item $menuBuilder
@param \Yajra\CMS\Entities\Menu $menu
Generate the menu .