Model
class Model extends Model implements CleansAttributes, Validable
Traits
Methods
Determine whether a method has any hooks registered.
Get the target relation and column from the mapping.
Determine whether the key is meta attribute or actual table field.
Create new Eloquence query builder for the instance.
Allow custom where method calls on the builder.
Determine whether all the attributes on this instance pass validation.
Determine whether validation is enabled for this instance.
Get names of the attributes that didn't pass validation.
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.
Details
in Eloquence at line 51
static void
bootEloquence()
Boot the trait.
in Eloquence at line 71
static void
hook(string $method, string $hook)
Register hook on Eloquent method.
in Eloquence at line 116
static boolean
hasHook(string $method)
Determine whether a method has any hooks registered.
in Eloquence at line 168
array
parseMappedColumn(string $mapping)
Get the target relation and column from the mapping.
in Eloquence at line 185
static boolean
hasColumn(string $key)
Determine whether the key is meta attribute or actual table field.
in Eloquence at line 197
array
getSearchableColumns()
Get searchable columns defined on the model.
in Eloquence at line 207
static array
getColumnListing()
Get model table columns.
in Eloquence at line 236
Builder
newEloquentBuilder(Builder $query)
Create new Eloquence query builder for the instance.
in Eloquence at line 249
static void
setAttributeMutator(Mutator $mutator)
Set attribute mutator instance.
in Eloquence at line 282
Builder
queryHook(Builder $query, string $method, ArgumentBag $args)
Allow custom where method calls on the builder.
in Eloquence at line 304
mixed
getAttribute(string $key)
Register hook for getAttribute.
in Eloquence at line 327
void
setAttribute(string $key, mixed $value)
Register hook for setAttribute.
in Eloquence at line 348
boolean
save(array $options = array())
Register hook for save.
in Eloquence at line 373
mixed
toArray()
Register hook for toArray.
in Eloquence at line 393
mixed
replicate(array $except = null)
Register hook for replicate.
in Eloquence at line 416
boolean
__isset(string $key)
Register hook for isset call.
in Eloquence at line 438
boolean
__unset(string $key)
Register hook for isset call.
in Eloquence at line 14
Connection
getConnection()
in Eloquence at line 14
string
getTable()
in Validable at line 47
static void
bootValidable()
Register hooks for the trait.
in Validable at line 63
boolean
isValid()
Determine whether all the attributes on this instance pass validation.
in Validable at line 75
$this
skipValidation()
Skip validation on the next saving attempt.
in Validable at line 85
$this
disableValidation($once = false)
Disable validation for this instance.
in Validable at line 97
$this
enableValidation()
Enable validation for this instance.
in Validable at line 109
integer|false
skipsValidation()
Get current validation flag.
in Validable at line 119
boolean
validationEnabled()
Determine whether validation is enabled for this instance.
in Validable at line 129
MessageBag
getValidationErrors()
Retrieve validation error messages.
in Validable at line 139
MessageBag
getMessageBag()
Retrieve validation error messages.
in Validable at line 149
array
getInvalidAttributes()
Get names of the attributes that didn't pass validation.
in Validable at line 159
Validator
getValidator()
Get the validator instance.
in Validable at line 178
static array
getValidationMessages()
Get custom validation messages.
in Validable at line 190
static array
getValidationAttributes()
Get custom validation attribute names.
in Validable at line 202
static array
getCreateRules()
Get all the validation rules for this model.
in Validable at line 257
array
getUpdateRules()
Get all validation rules for update on this model.
in Validable at line 268
static array
getUpdateRulesForId(Model|string $id)
Get all validation rules for update for given id.
in Validable at line 278
static array
getValidatedFields()
Get array of attributes that have validation rules defined.
in Validable at line 324
static void
setValidatorFactory(Factory $factory)
Set validation factory instance for this model.