src/Menus/MenuFactory.php
public function add($id)
    {
        if ($this->has($id)) {
            return $this->get($id);
        }

        $menu = $this->container->make(Menu::class, [
            'menuFactory' => $this
        ]);
        $this->runHook('menu-factory:add', [$this, $menu]);
        $this->menus->put($id, $menu);
        return $menu;
    }
public function add($id)
    {
        if ($this->has($id)) {
            return $this->get($id);
        }

        $menu = $this->container->make(Menu::class, [
            'menuFactory' => $this
        ]);
        $this->runHook('menu-factory:add', [$this, $menu]);
        $this->menus->put($id, $menu);
        return $menu;
    }
public function add ( $ id ) { if ( $ this -> has ( $ id ) ) { return $ this -> get ( $ id ) ; } $ menu = $ this -> container -> make ( Menu :: class , [ 'menuFactory' => $ this ] ) ; $ this -> runHook ( 'menu-factory:add' , [ $ this , $ menu ] ) ; $ this -> menus -> put ( $ id , $ menu ) ; return $ menu ; }
Creates a new menu or returns an existing

@param string $id
@return \Docit\Core\Menus\Menu
Creates a new menu or returns an existing