GuardsAttributes
trait GuardsAttributes (View source)
Properties
protected array | $fillable | The attributes that are mass assignable. | |
protected array | $guarded | The attributes that aren't mass assignable. | |
static protected bool | $unguarded | Indicates if all mass assignment is enabled. |
Methods
Get the fillable attributes for the model.
Set the fillable attributes for the model.
Get the guarded attributes for the model.
Set the guarded attributes for the model.
Disable all mass assignable restrictions.
Enable the mass assignment restrictions.
Determine if current state is "unguarded".
Run the given callable while being unguarded.
Determine if the given attribute may be mass assigned.
Determine if the given key is guarded.
Determine if the model is totally guarded.
Get the fillable attributes of a given array.
Details
at line 35
array
getFillable()
Get the fillable attributes for the model.
at line 46
$this
fillable(array $fillable)
Set the fillable attributes for the model.
at line 58
array
getGuarded()
Get the guarded attributes for the model.
at line 69
$this
guard(array $guarded)
Set the guarded attributes for the model.
at line 82
static void
unguard(bool $state = true)
Disable all mass assignable restrictions.
at line 92
static void
reguard()
Enable the mass assignment restrictions.
at line 102
static bool
isUnguarded()
Determine if current state is "unguarded".
at line 113
static mixed
unguarded(callable $callback)
Run the given callable while being unguarded.
at line 134
bool
isFillable(string $key)
Determine if the given attribute may be mass assigned.
at line 164
bool
isGuarded(string $key)
Determine if the given key is guarded.
at line 174
bool
totallyGuarded()
Determine if the model is totally guarded.
at line 185
protected array
fillableFromArray(array $attributes)
Get the fillable attributes of a given array.