src/Console/Routes/Controller.php
public function prompt($text, $options = [])
    {
        if ($this->interactive) {
            return Console::prompt($text, $options);
        }

        $default = isset($options['default']) ? $options['default'] : '';
        return resolve($default);
    }
public function prompt($text, $options = [])
    {
        if ($this->interactive) {
            return Console::prompt($text, $options);
        }

        $default = isset($options['default']) ? $options['default'] : '';
        return resolve($default);
    }
Prompts the user for input and validates it.

@param string $text prompt string
@param array $options the options to validate the input:

- required: whether it is required or not
- default: default value if no input is inserted by the user
- pattern: regular expression pattern to validate user input
- validator: a callable function to validate input. The function must accept two parameters:
- $input: the user input to validate
- $error: the error value passed by reference if validation failed.

An example of how to use the prompt method with a validator function.

```php
$code = $this->prompt('Enter 4-Chars-Pin', ['required' => true, 'validator' => function($input, &$error) {
if (strlen($input) !== 4) {
$error = 'The Pin must be exactly 4 chars!';
return false;
}
return true;
}]);
```

@return ExtendedPromiseInterface with string the user input