public function addQuestion(string $label, string $placeholder = ''): Menu
    {
        $itemCallable = function (CliMenu $menu) use ($label, $placeholder) {
            $result = $menu->askText()
                ->setPromptText($label)
                ->setPlaceholderText($placeholder)
                ->ask();

            $this->result = $result->fetch();

            $menu->close();
        };

        $this->addItem($label, $itemCallable);

        return $this;
    }
public function addQuestion(string $label, string $placeholder = ''): Menu
    {
        $itemCallable = function (CliMenu $menu) use ($label, $placeholder) {
            $result = $menu->askText()
                ->setPromptText($label)
                ->setPlaceholderText($placeholder)
                ->ask();

            $this->result = $result->fetch();

            $menu->close();
        };

        $this->addItem($label, $itemCallable);

        return $this;
    }
public function addQuestion ( string $ label , string $ placeholder = '' ) : Menu { $ itemCallable = function ( CliMenu $ menu ) use ( $ label , $ placeholder ) { $ result = $ menu -> askText ( ) -> setPromptText ( $ label ) -> setPlaceholderText ( $ placeholder ) -> ask ( ) ; $ this -> result = $ result -> fetch ( ) ; $ menu -> close ( ) ; } ; $ this -> addItem ( $ label , $ itemCallable ) ; return $ this ; }
Add a question.

@param string $label
@param string $placeholder

@return \NunoMaduro\LaravelConsoleMenu\Menu
Add a question .