Documentation

ValidationException extends Exception
in package

Table of Contents

$errorBag  : string
The name of the error bag.
$redirectTo  : string
The path the client should be redirected to.
$response  : Response|null
The recommended response to send to the client.
$status  : int
The status code to use for the response.
$validator  : Validator
The validator instance.
__construct()  : void
Create a new exception instance.
errorBag()  : $this
Set the error bag on the exception.
errors()  : array<string|int, mixed>
Get all of the validation error messages.
getResponse()  : Response|null
Get the underlying response instance.
redirectTo()  : $this
Set the URL to redirect to on a validation error.
status()  : $this
Set the HTTP status code to be used for the response.
withMessages()  : static
Create a new validation exception from a plain array of messages.

Properties

Methods

__construct()

Create a new exception instance.

public __construct(Validator $validator[, Response $response = null ][, string $errorBag = 'default' ]) : void
Parameters
$validator : Validator
$response : Response = null
$errorBag : string = 'default'
Return values
void

errorBag()

Set the error bag on the exception.

public errorBag(string $errorBag) : $this
Parameters
$errorBag : string
Return values
$this

errors()

Get all of the validation error messages.

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

redirectTo()

Set the URL to redirect to on a validation error.

public redirectTo(string $url) : $this
Parameters
$url : string
Return values
$this

status()

Set the HTTP status code to be used for the response.

public status(int $status) : $this
Parameters
$status : int
Return values
$this

withMessages()

Create a new validation exception from a plain array of messages.

public static withMessages(array<string|int, mixed> $messages) : static
Parameters
$messages : array<string|int, mixed>
Return values
static

Search results