GuardsAttributes
Properties
$fillable string[]
The attributes that are mass assignable.
$guarded string[]|bool
The attributes that aren't mass assignable.
$unguarded bool
Indicates if all mass assignment is enabled.
$guardableColumns string[]
The actual columns that exist on the database and can be guarded.
Methods
getFillable ( ) : string[]
Get the fillable attributes for the model.
fillable ( array $fillable ) : $this
Set the fillable attributes for the model.
Parameters
- $fillable string[]
mergeFillable ( array $fillable ) : $this
Merge new fillable attributes with existing fillable attributes on the model.
Parameters
- $fillable string[]
getGuarded ( ) : string[]
Get the guarded attributes for the model.
guard ( array $guarded ) : $this
Set the guarded attributes for the model.
Parameters
- $guarded string[]
mergeGuarded ( array $guarded ) : $this
Merge new guarded attributes with existing guarded attributes on the model.
Parameters
- $guarded string[]
unguard ( $state ) : void
Disable all mass assignable restrictions.
Parameters
- $state bool
reguard ( ) : void
Enable the mass assignment restrictions.
isUnguarded ( ) : bool
Determine if the current state is "unguarded".
unguarded ( callable $callback ) : mixed
Run the given callable while being unguarded.
Parameters
- $callback callable
isFillable ( $key ) : bool
Determine if the given attribute may be mass assigned.
Parameters
- $key string
isGuarded ( $key ) : bool
Determine if the given key is guarded.
Parameters
- $key string
isGuardableColumn ( $key ) : bool
Determine if the given column is a valid, guardable column.
Parameters
- $key string
totallyGuarded ( ) : bool
Determine if the model is totally guarded.
fillableFromArray ( array $attributes ) : array
Get the fillable attributes of a given array.
Parameters
- $attributes array