Validator

interface Validator implements MessageProvider (View source)

Methods

MessageBag getMessageBag()

Get the messages for the instance.

from MessageProvider
bool fails()

Determine if the data fails the validation rules.

array failed()

Get the failed validation rules.

$this sometimes(string $attribute, string|array $rules, callable $callback)

Add conditions to a given field based on a Closure.

$this after(callable|string $callback)

After an after validation callback.

MessageBag errors()

Get all of the validation error messages.

Details

MessageBag getMessageBag()

Get the messages for the instance.

Return Value

MessageBag

bool fails()

Determine if the data fails the validation rules.

Return Value

bool

array failed()

Get the failed validation rules.

Return Value

array

$this sometimes(string $attribute, string|array $rules, callable $callback)

Add conditions to a given field based on a Closure.

Parameters

string $attribute
string|array $rules
callable $callback

Return Value

$this

$this after(callable|string $callback)

After an after validation callback.

Parameters

callable|string $callback

Return Value

$this

MessageBag errors()

Get all of the validation error messages.

Return Value

MessageBag

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.5/Illuminate/Contracts/Validation/Validator.html