public function create($name, $options = [])
    {
        if ($this->menus->has($name)) {
            throw new MenuAlreadyExistsException("Can not create menu named `$name` because it already exists");
        }

        $this->menus->put($name, $instance = MenuFactory::create($name, $options));

        return $instance;
    }
public function create($name, $options = [])
    {
        if ($this->menus->has($name)) {
            throw new MenuAlreadyExistsException("Can not create menu named `$name` because it already exists");
        }

        $this->menus->put($name, $instance = MenuFactory::create($name, $options));

        return $instance;
    }
public function create ( $ name , $ options = [ ] ) { if ( $ this -> menus -> has ( $ name ) ) { throw new MenuAlreadyExistsException ( "Can not create menu named `$name` because it already exists" ) ; } $ this -> menus -> put ( $ name , $ instance = MenuFactory :: create ( $ name , $ options ) ) ; return $ instance ; }
Create a new menu instance

@param string    $name       The name of the menu
@param array     $options    Set of options

@see processOptions() method

@return Menu
@throws MenuAlreadyExistsException
Create a new menu instance