class ValidationException extends Exception (View source)
Validator | $validator | The validator instance. | |
Response|null | $response | The recommended response to send to the client. | |
int | $status | The status code to use for the response. | |
string | $errorBag | The name of the error bag. | |
string | $redirectTo | The path the client should be redirected to. |
void | __construct(Validator $validator, Response|null $response = null, string $errorBag = 'default') Create a new exception instance. | |
static ValidationException | withMessages(array $messages) Create a new validation exception from a plain array of messages. | |
array | errors() Get all of the validation error messages. | |
$this | status(int $status) Set the HTTP status code to be used for the response. | |
$this | errorBag(string $errorBag) Set the error bag on the exception. | |
$this | redirectTo(string $url) Set the URL to redirect to on a validation error. | |
Response|null | getResponse() Get the underlying response instance. |
Create a new exception instance.
Create a new validation exception from a plain array of messages.
Get all of the validation error messages.
Set the HTTP status code to be used for the response.
Set the error bag on the exception.
Set the URL to redirect to on a validation error.
Get the underlying response instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Validation/ValidationException.html