October\Rain\Database\ModelException

Source: ~/vendor/october/rain/src/Database/ModelException.php

Extends:

Implements:

  • Throwable

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

Protected properties

protected Model $model

The invalid model.

Show inherited protected properties

Inherited protected properties

  • protected array $fields - defined in October\Rain\Exception\ValidationException. Collection of invalid fields.
  • protected Illuminate\Support\MessageBag $errors - defined in October\Rain\Exception\ValidationException. The message bag instance containing validation error messages.
  • protected $message - defined in Exception.
  • protected $code - defined in Exception.
  • protected $file - defined in Exception.
  • protected $line - defined in Exception.

Public methods

public void __construct(Model $model)

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

Parameters
  • Model $model - The troublesome model.

public Model getModel()

Returns the model with invalid attributes.

Show inherited public methods

Inherited public methods

  • public void __toString() - defined in Exception.
  • public void __wakeup() - defined in Exception.
  • public void getCode() - defined in Exception.
  • public Illuminate\Support\MessageBag getErrors() - defined in October\Rain\Exception\ValidationException. Returns directly the message bag instance with the model's errors.
  • public void getFields() - defined in October\Rain\Exception\ValidationException. Returns invalid fields.
  • public void getFile() - defined in Exception.
  • public void getLine() - defined in Exception.
  • public void getMessage() - defined in Exception.
  • public void getPrevious() - defined in Exception.
  • public void getTrace() - defined in Exception.
  • public void getTraceAsString() - defined in Exception.

Protected methods

Show inherited protected methods

Inherited protected methods