Validable
trait Validable
Methods
Register hooks for the trait.
Determine whether all the attributes on this instance pass validation.
Skip validation on the next saving attempt.
Disable validation for this instance.
Enable validation for this instance.
Get current validation flag.
Determine whether validation is enabled for this instance.
Retrieve validation error messages.
Retrieve validation error messages.
Get names of the attributes that didn't pass validation.
Get the validator instance.
Get custom validation messages.
Get custom validation attribute names.
Get all the validation rules for this model.
Get all validation rules for update on this model.
Get all validation rules for update for given id.
Get array of attributes that have validation rules defined.
Set validation factory instance for this model.
No description
No description
Details
at line 47
static void
bootValidable()
Register hooks for the trait.
at line 63
boolean
isValid()
Determine whether all the attributes on this instance pass validation.
at line 75
$this
skipValidation()
Skip validation on the next saving attempt.
at line 85
$this
disableValidation($once = false)
Disable validation for this instance.
at line 97
$this
enableValidation()
Enable validation for this instance.
at line 109
integer|false
skipsValidation()
Get current validation flag.
at line 119
boolean
validationEnabled()
Determine whether validation is enabled for this instance.
at line 129
MessageBag
getValidationErrors()
Retrieve validation error messages.
at line 139
MessageBag
getMessageBag()
Retrieve validation error messages.
at line 149
array
getInvalidAttributes()
Get names of the attributes that didn't pass validation.
at line 159
Validator
getValidator()
Get the validator instance.
at line 178
static array
getValidationMessages()
Get custom validation messages.
at line 190
static array
getValidationAttributes()
Get custom validation attribute names.
at line 202
static array
getCreateRules()
Get all the validation rules for this model.
at line 257
array
getUpdateRules()
Get all validation rules for update on this model.
at line 268
static array
getUpdateRulesForId(Model|string $id)
Get all validation rules for update for given id.
at line 278
static array
getValidatedFields()
Get array of attributes that have validation rules defined.
at line 324
static void
setValidatorFactory(Factory $factory)
Set validation factory instance for this model.