trait Validable

Methods

static void
bootValidable()

Register hooks for the trait.

boolean
isValid()

Determine whether all the attributes on this instance pass validation.

$this
skipValidation()

Skip validation on the next saving attempt.

$this
disableValidation($once = false)

Disable validation for this instance.

$this
enableValidation()

Enable validation for this instance.

integer|false
skipsValidation()

Get current validation flag.

boolean
validationEnabled()

Determine whether validation is enabled for this instance.

MessageBag
getValidationErrors()

Retrieve validation error messages.

MessageBag
getMessageBag()

Retrieve validation error messages.

array
getInvalidAttributes()

Get names of the attributes that didn't pass validation.

Validator
getValidator()

Get the validator instance.

static array
getValidationMessages()

Get custom validation messages.

static array
getValidationAttributes()

Get custom validation attribute names.

static array
getCreateRules()

Get all the validation rules for this model.

array
getUpdateRules()

Get all validation rules for update on this model.

static array
getUpdateRulesForId(Model|string $id)

Get all validation rules for update for given id.

static array
getValidatedFields()

Get array of attributes that have validation rules defined.

static void
setValidatorFactory(Factory $factory)

Set validation factory instance for this model.

integer
getKey()

No description

string
getKeyName()

No description

Details

at line 47
static void bootValidable()

Register hooks for the trait.

Return Value

void

at line 63
boolean isValid()

Determine whether all the attributes on this instance pass validation.

Return Value

boolean

at line 75
$this skipValidation()

Skip validation on the next saving attempt.

Return Value

$this

at line 85
$this disableValidation($once = false)

Disable validation for this instance.

Parameters

$once

Return Value

$this

at line 97
$this enableValidation()

Enable validation for this instance.

Return Value

$this

at line 109
integer|false skipsValidation()

Get current validation flag.

Return Value

integer|false

at line 119
boolean validationEnabled()

Determine whether validation is enabled for this instance.

Return Value

boolean

at line 129
MessageBag getValidationErrors()

Retrieve validation error messages.

Return Value

MessageBag

at line 139
MessageBag getMessageBag()

Retrieve validation error messages.

Return Value

MessageBag

at line 149
array getInvalidAttributes()

Get names of the attributes that didn't pass validation.

Return Value

array

at line 159
Validator getValidator()

Get the validator instance.

Return Value

Validator

at line 178
static array getValidationMessages()

Get custom validation messages.

Return Value

array

at line 190
static array getValidationAttributes()

Get custom validation attribute names.

Return Value

array

at line 202
static array getCreateRules()

Get all the validation rules for this model.

Return Value

array

at line 257
array getUpdateRules()

Get all validation rules for update on this model.

Return Value

array

at line 268
static array getUpdateRulesForId(Model|string $id)

Get all validation rules for update for given id.

Parameters

Model|string $id

Return Value

array

at line 278
static array getValidatedFields()

Get array of attributes that have validation rules defined.

Return Value

array

at line 324
static void setValidatorFactory(Factory $factory)

Set validation factory instance for this model.

Parameters

Factory $factory

Return Value

void

at line 10
integer getKey()

Return Value

integer

at line 10
string getKeyName()

Return Value

string