class Validator implements Validator (View source)
FormatsMessages |
ValidatesAttributes |
ReplacesAttributes |
array | $customMessages | The array of custom error messages. | |
array | $fallbackMessages | The array of fallback error messages. | |
array | $customAttributes | The array of custom attribute names. | |
array | $customValues | The array of custom displayable values. | |
array | $extensions | All of the custom validator extensions. | |
array | $replacers | All of the custom replacer extensions. |
string | makeReplacements(string $message, string $attribute, string $rule, array $parameters) Replace all error message place-holders with actual values. | from FormatsMessages |
string | getDisplayableValue(string $attribute, mixed $value) Get the displayable name of the value. | from FormatsMessages |
string | guessColumnForQuery(string $attribute) Guess the database column from the given attribute name. | from ValidatesAttributes |
bool | isValidFileInstance(mixed $value) Check that the given value is a valid file instance. | from ValidatesAttributes |
void | __construct(Translator $translator, array $data, array $rules, array $messages = array(), array $customAttributes = array()) Create a new Validator instance. | |
array | parseData(array $data) Parse the data array, converting dots to ->. | |
$this | after(callable|string $callback) Add an after validation callback. | |
bool | passes() Determine if the data passes the validation rules. | |
bool | fails() Determine if the data fails the validation rules. | |
void | validate() Run the validator's rules against its data. | |
array | valid() Returns the data which was valid. | |
array | invalid() Returns the data which was invalid. | |
array | failed() Get the failed validation rules. | |
MessageBag | messages() Get the message container for the validator. | |
MessageBag | errors() An alternative more semantic shortcut to the message container. | |
MessageBag | getMessageBag() Get the messages for the instance. | |
bool | hasRule(string $attribute, string|array $rules) Determine if the given attribute has a rule in the given set. | |
array | attributes() Get the data under validation. | |
array | getData() Get the data under validation. | |
$this | setData(array $data) Set the data under validation. | |
array | getRules() Get the validation rules. | |
$this | setRules(array $rules) Set the validation rules. | |
void | addRules(array $rules) Parse the given rules and merge them into current rules. | |
$this | sometimes(string $attribute, string|array $rules, callable $callback) Add conditions to a given field based on a Closure. | |
void | addExtensions(array $extensions) Register an array of custom validator extensions. | |
void | addImplicitExtensions(array $extensions) Register an array of custom implicit validator extensions. | |
void | addExtension(string $rule, Closure|string $extension) Register a custom validator extension. | |
void | addImplicitExtension(string $rule, Closure|string $extension) Register a custom implicit validator extension. | |
void | addReplacers(array $replacers) Register an array of custom validator message replacers. | |
void | addReplacer(string $rule, Closure|string $replacer) Register a custom validator message replacer. | |
void | setCustomMessages(array $messages) Set the custom messages for the validator. | |
$this | setAttributeNames(array $attributes) Set the custom attributes on the validator. | |
$this | addCustomAttributes(array $customAttributes) Add custom attributes to the validator. | |
$this | setValueNames(array $values) Set the custom values on the validator. | |
$this | addCustomValues(array $customValues) Add the custom values for the validator. | |
void | setFallbackMessages(array $messages) Set the fallback messages for the validator. | |
PresenceVerifierInterface | getPresenceVerifier() Get the Presence Verifier implementation. | |
void | setPresenceVerifier(PresenceVerifierInterface $presenceVerifier) Set the Presence Verifier implementation. | |
Translator | getTranslator() Get the Translator implementation. | |
void | setTranslator(Translator $translator) Set the Translator implementation. | |
void | setContainer(Container $container) Set the IoC container instance. | |
mixed | __call(string $method, array $parameters) Handle dynamic calls to class methods. |
Replace all error message place-holders with actual values.
Get the displayable name of the value.
Guess the database column from the given attribute name.
Check that the given value is a valid file instance.
Create a new Validator instance.
Parse the data array, converting dots to ->.
Add an after validation callback.
Determine if the data passes the validation rules.
Determine if the data fails the validation rules.
Run the validator's rules against its data.
Returns the data which was valid.
Returns the data which was invalid.
Get the failed validation rules.
Get the message container for the validator.
An alternative more semantic shortcut to the message container.
Get the messages for the instance.
Determine if the given attribute has a rule in the given set.
Get the data under validation.
Get the data under validation.
Set the data under validation.
Get the validation rules.
Set the validation rules.
Parse the given rules and merge them into current rules.
Add conditions to a given field based on a Closure.
Register an array of custom validator extensions.
Register an array of custom implicit validator extensions.
Register a custom validator extension.
Register a custom implicit validator extension.
Register an array of custom validator message replacers.
Register a custom validator message replacer.
Set the custom messages for the validator.
Set the custom attributes on the validator.
Add custom attributes to the validator.
Set the custom values on the validator.
Add the custom values for the validator.
Set the fallback messages for the validator.
Get the Presence Verifier implementation.
Set the Presence Verifier implementation.
Get the Translator implementation.
Set the Translator implementation.
Set the IoC container instance.
Handle dynamic calls to class methods.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Validation/Validator.html