class Illuminate / Validation / ValidationException

ValidationException

Extends

Properties

public

$validator Validator

The validator instance.

Default: null
public

$response Symfony\...\Response|null

The recommended response to send to the client.

Default: null
public

$status int

The status code to use for the response.

Default: 422
public

$errorBag string

The name of the error bag.

Default: null
public

$redirectTo string

The path the client should be redirected to.

Default: null

Methods

public

__construct ( $validator , $response , $errorBag ) : void

Create a new exception instance.

Parameters

  • $validator Validator
  • $response Symfony\...\Response|null
  • $errorBag string
public static

withMessages ( array $messages ) : static

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

Parameters

  • $messages array
protected static

summarize ( $validator ) : string

Create an error message summary from the validation errors.

Parameters

public

errors ( ) : array

Get all of the validation error messages.

public

status ( $status ) : $this

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

Parameters

  • $status int
public

errorBag ( $errorBag ) : $this

Set the error bag on the exception.

Parameters

  • $errorBag string
public

redirectTo ( $url ) : $this

Set the URL to redirect to on a validation error.

Parameters

  • $url string
public

getResponse ( ) : Symfony\...\Response|null

Get the underlying response instance.