Validator
interface Validator implements MessageProvider
Methods
Run the validator's rules against its data.
Get the attributes and values that were validated.
Determine if the data fails the validation rules.
Get the failed validation rules.
Add conditions to a given field based on a Closure.
Get all of the validation error messages.
Get the Translator implementation.
Get the data under validation.
Get the validation rules with key placeholders removed.
Get a validated input container for the validated input.
Instruct the validator to stop validating after the first rule failure.
Determine if a given rule is defined for a given attribute.
Get the exception to throw upon failed validation.
Details
in
MessageProvider at line 12
MessageBag
getMessageBag()
Get the messages for the instance.
at line 20
array
validate()
Run the validator's rules against its data.
at line 27
array
validated()
Get the attributes and values that were validated.
at line 32
bool
fails()
Determine if the data fails the validation rules.
at line 37
array
failed()
Get the failed validation rules.
at line 42
Validator
sometimes(array|string $attribute, array|string $rules, callable $callback)
Add conditions to a given field based on a Closure.
at line 47
Validator
after(callable|string $callback)
Add an after validation callback.
at line 52
MessageBag
errors()
Get all of the validation error messages.
at line 57
Translator
getTranslator()
Get the Translator implementation.
at line 62
array
getData()
Get the data under validation.
at line 67
Validator
setData(array $data)
Set the data under validation.
at line 72
array
getRulesWithoutPlaceholders()
Get the validation rules with key placeholders removed.
at line 77
Validator
setRules(array $rules)
Set the validation rules.
at line 82
array|ValidatedInput
safe(array|null $keys = null)
Get a validated input container for the validated input.
at line 89
Validator
stopOnFirstFailure(bool $stopOnFirstFailure = true)
Instruct the validator to stop validating after the first rule failure.
at line 94
bool
hasRule(string $attribute, array|string $rules)
Determine if a given rule is defined for a given attribute.
at line 101
string
getException()
Get the exception to throw upon failed validation.