ValidationException class

  • Illuminate\Validation\ValidationException
  • Exception
  • Throwable
  • Stringable

Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

  • $validator - The validator instance. (defined in Illuminate\Validation\ValidationException)
  • $response - The recommended response to send to the client. (defined in Illuminate\Validation\ValidationException)
  • $status - The status code to use for the response. (defined in Illuminate\Validation\ValidationException)
  • $errorBag - The name of the error bag. (defined in Illuminate\Validation\ValidationException)
  • $redirectTo - The path the client should be redirected to. (defined in Illuminate\Validation\ValidationException)

Protected Properties

protected array $fields

fields that are invalid

protected array $fieldPrefix

protected Illuminate\Support\MessageBag $errors

errors in the form of a message bag

Show inherited protected properties

Inherited Protected Properties

  • $message - (defined in Exception)
  • $code - (defined in Exception)
  • $file - (defined in Exception)
  • $line - (defined in Exception)

Public Methods

public __construct()

public __construct($validation): void

__construct the validation exception.

public getErrors()

public getErrors(): Illuminate\Support\MessageBag 

getErrors returns directly the message bag instance with the model's errors

public getFields()

public getFields(): void

getFields returns invalid fields

public setFieldPrefix()

public setFieldPrefix($prefix): void

setFieldPrefix increases the field target specificity

Show inherited public methods

Inherited Public Methods

  • __toString() - (defined in Exception)
  • __wakeup() - (defined in Exception)
  • errorBag() - Set the error bag on the exception. (defined in Illuminate\Validation\ValidationException)
  • errors() - Get all of the validation error messages. (defined in Illuminate\Validation\ValidationException)
  • getCode() - (defined in Exception)
  • getFile() - (defined in Exception)
  • getLine() - (defined in Exception)
  • getMessage() - (defined in Exception)
  • getPrevious() - (defined in Exception)
  • getResponse() - Get the underlying response instance. (defined in Illuminate\Validation\ValidationException)
  • getTrace() - (defined in Exception)
  • getTraceAsString() - (defined in Exception)
  • redirectTo() - Set the URL to redirect to on a validation error. (defined in Illuminate\Validation\ValidationException)
  • status() - Set the HTTP status code to be used for the response. (defined in Illuminate\Validation\ValidationException)
  • withMessages() - Create a new validation exception from a plain array of messages. (defined in Illuminate\Validation\ValidationException)

Protected Methods

protected evalErrors()

protected evalErrors(): void

evalErrors evaluates errors

protected resolveToValidator()

protected resolveToValidator(mixed $validation): void

resolveToValidator resolves general input for the validation exception

Show inherited protected methods

Inherited Protected Methods

  • summarize() - Create an error message summary from the validation errors. (defined in Illuminate\Validation\ValidationException)