Choice
class Choice extends Component (View source)
Properties
| protected OutputStyle | $output | The output style implementation. |
from Component |
| protected array<int, callable(string): string> | $mutators | The list of mutators to apply on the view data. |
from Component |
Methods
Mutates the given data with the given set of mutators.
Eventually performs a question using the component's question helper.
Renders the component using the given arguments.
Get a ChoiceQuestion instance that handles array keys like Prompts.
No description
Details
void
__construct(OutputStyle $output)
Creates a new component instance.
protected void
renderView(string $view, Arrayable|array $data, int $verbosity)
Renders the given view.
protected void
compile(string $view, array $data)
Compile the given view contents.
protected array<int, string>|string
mutate(array<int, string>|string $data, array<int, callable(string): string> $mutators)
Mutates the given data with the given set of mutators.
protected mixed
usingQuestionHelper(callable $callable)
Eventually performs a question using the component's question helper.
mixed
render(string $question, array<array-key, string> $choices, mixed $default = null, int $attempts = null, bool $multiple = false)
Renders the component using the given arguments.
protected ChoiceQuestion
getChoiceQuestion(string $question, array $choices, mixed $default)
Get a ChoiceQuestion instance that handles array keys like Prompts.
protected bool
isAssoc(array $array)
No description
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.