Documentation

Validator extends MessageProvider

Table of Contents

after()  : $this
After an after validation callback.
errors()  : MessageBag
Get all of the validation error messages.
failed()  : array<string|int, mixed>
Get the failed validation rules.
fails()  : bool
Determine if the data fails the validation rules.
getMessageBag()  : MessageBag
Get the messages for the instance.
sometimes()  : $this
Add conditions to a given field based on a Closure.

Methods

after()

After an after validation callback.

public after(callable|string $callback) : $this
Parameters
$callback : callable|string
Return values
$this

failed()

Get the failed validation rules.

public failed() : array<string|int, mixed>
Return values
array<string|int, mixed>

fails()

Determine if the data fails the validation rules.

public fails() : bool
Return values
bool

sometimes()

Add conditions to a given field based on a Closure.

public sometimes(string $attribute, string|array<string|int, mixed> $rules, callable $callback) : $this
Parameters
$attribute : string
$rules : string|array<string|int, mixed>
$callback : callable
Return values
$this

Search results