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.  | 
                |
| static protected array | $guardableColumns | The actual columns that exist on the database and can be guarded.  | 
                
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 given column is a valid, guardable column.
Determine if the model is totally guarded.
Get the fillable attributes of a given array.
Details
        
                            array
    getFillable()
        
    
    Get the fillable attributes for the model.
        
                            $this
    fillable(array $fillable)
        
    
    Set the fillable attributes for the model.
        
                            array
    getGuarded()
        
    
    Get the guarded attributes for the model.
        
                            $this
    guard(array $guarded)
        
    
    Set the guarded attributes for the model.
        
                static            void
    unguard(bool $state = true)
        
    
    Disable all mass assignable restrictions.
        
                static            void
    reguard()
        
    
    Enable the mass assignment restrictions.
        
                static            bool
    isUnguarded()
        
    
    Determine if current state is "unguarded".
        
                static            mixed
    unguarded(callable $callback)
        
    
    Run the given callable while being unguarded.
        
                            bool
    isFillable(string $key)
        
    
    Determine if the given attribute may be mass assigned.
        
                            bool
    isGuarded(string $key)
        
    
    Determine if the given key is guarded.
        
                    protected        bool
    isGuardableColumn(string $key)
        
    
    Determine if the given column is a valid, guardable column.
        
                            bool
    totallyGuarded()
        
    
    Determine if the model is totally guarded.
        
                    protected        array
    fillableFromArray(array $attributes)
        
    
    Get the fillable attributes of a given array.