trait ConfiguresPrompts (View source)

Methods

void
configurePrompts(InputInterface $input)

Configure the prompt fallbacks.

PResult
promptUntilValid(PResult $prompt, bool|string $required, PResult): mixed|null $validate)

Prompt the user until the given validation callback passes.

?string
validatePrompt(mixed $value, mixed $rules)

Validate the given prompt value using the validator.

getPromptValidatorInstance(mixed $field, mixed $value, mixed $rules, array $messages = [], array $attributes = [])

Get the validator instance that should be used to validate prompts.

array<string, string>
validationMessages()

Get the validation messages that should be used during prompt validation.

array<string, string>
validationAttributes()

Get the validation attributes that should be used during prompt validation.

void
restorePrompts()

Restore the prompts output.

Details

protected void configurePrompts(InputInterface $input)

Configure the prompt fallbacks.

Parameters

InputInterface $input

Return Value

void

protected PResult promptUntilValid(PResult $prompt, bool|string $required, PResult): mixed|null $validate)

Prompt the user until the given validation callback passes.

Parameters

PResult $prompt
bool|string $required
PResult): mixed|null $validate

Return Value

PResult

Exceptions

PromptValidationException

protected ?string validatePrompt(mixed $value, mixed $rules)

Validate the given prompt value using the validator.

Parameters

mixed $value
mixed $rules

Return Value

?string

protected Validator getPromptValidatorInstance(mixed $field, mixed $value, mixed $rules, array $messages = [], array $attributes = [])

Get the validator instance that should be used to validate prompts.

Parameters

mixed $field
mixed $value
mixed $rules
array $messages
array $attributes

Return Value

Validator

protected array<string, string> validationMessages()

Get the validation messages that should be used during prompt validation.

Return Value

array<string, string>

protected array<string, string> validationAttributes()

Get the validation attributes that should be used during prompt validation.

Return Value

array<string, string>

protected void restorePrompts()

Restore the prompts output.

Return Value

void

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.