interface Validator implements MessageProvider (View source)

Methods

getMessageBag()

Get the messages for the instance.

array
validate()

Run the validator's rules against its data.

array
validated()

Get the attributes and values that were validated.

bool
fails()

Determine if the data fails the validation rules.

array
failed()

Get the failed validation rules.

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

Add conditions to a given field based on a Closure.

$this
after(callable|string $callback)

Add an after validation callback.

errors()

Get all of the validation error messages.

Details

MessageBag getMessageBag()

Get the messages for the instance.

Return Value

MessageBag

array validate()

Run the validator's rules against its data.

Return Value

array

array validated()

Get the attributes and values that were validated.

Return Value

array

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|array $attribute, string|array $rules, callable $callback)

Add conditions to a given field based on a Closure.

Parameters

string|array $attribute
string|array $rules
callable $callback

Return Value

$this

$this after(callable|string $callback)

Add an after validation callback.

Parameters

callable|string $callback

Return Value

$this

MessageBag errors()

Get all of the validation error messages.

Return Value

MessageBag