ModelException
extends ValidationException
in package
Used when validation fails. Contains the invalid model for easy analysis.
Tags
Table of Contents
- $errors : MessageBag
- $fields : array<string|int, mixed>
- $model : Model
- __construct() : mixed
- Receives the invalid model and sets the {@link model} and {@link errors} properties.
- getErrors() : MessageBag
- Returns directly the message bag instance with the model's errors.
- getFields() : mixed
- Returns invalid fields.
- getModel() : Model
- Returns the model with invalid attributes.
- evalErrors() : mixed
- Evaluate errors.
Properties
$errors
protected
MessageBag
$errors
The message bag instance containing validation error messages
$fields
protected
array<string|int, mixed>
$fields
Collection of invalid fields.
$model
protected
Model
$model
The invalid model.
Methods
__construct()
Receives the invalid model and sets the {@link model} and {@link errors} properties.
public
__construct(Model $model) : mixed
Parameters
- $model : Model
-
The troublesome model.
Return values
mixed —getErrors()
Returns directly the message bag instance with the model's errors.
public
getErrors() : MessageBag
Return values
MessageBag —getFields()
Returns invalid fields.
public
getFields() : mixed
Return values
mixed —getModel()
Returns the model with invalid attributes.
public
getModel() : Model
Return values
Model —evalErrors()
Evaluate errors.
protected
evalErrors() : mixed