class ModelException extends ValidationException

Used when validation fails. Contains the invalid model for easy analysis.

Properties

protected array $fields from  ValidationException
protected MessageBag $errors from  ValidationException
protected Model $model

Methods

void
__construct(Model $model)

Receives the invalid model and sets the model} and {@link errors properties.

Model
model()

Get the mdoel with validation errors.

Model
getModel()

Returns the model with invalid attributes.

evalErrors()

Evaluate errors.

MessageBag
getErrors()

Returns directly the message bag instance with the model's errors.

getFields()

Returns invalid fields.

Details

at line 24
void __construct(Model $model)

Receives the invalid model and sets the model} and {@link errors properties.

Parameters

Model $model

Return Value

void

Model model()

Get the mdoel with validation errors.

Return Value

Model

at line 35
Model getModel()

Returns the model with invalid attributes.

Return Value

Model

protected evalErrors()

Evaluate errors.

MessageBag getErrors()

Returns directly the message bag instance with the model's errors.

Return Value

MessageBag

in ValidationException at line 104
getFields()

Returns invalid fields.