GuardedPropertyTrait
Provides support for blacklisting explicit properties from the mass assignment behavior.
Table of Contents
Properties
- $guarded : array<string|int, mixed>
- The properties that aren't mass assignable.
Methods
- getGuarded() : array<string|int, mixed>
- Returns current guarded properties.
- isGuarded() : bool
- Determines if the given property is guarded.
- fillProperties() : mixed
- Attempts to mass assign the given options to explicitly defined properties, skipping over any properties that are defined in the guarded array.
Properties
$guarded
The properties that aren't mass assignable.
protected
array<string|int, mixed>
$guarded
= []
Methods
getGuarded()
Returns current guarded properties.
public
getGuarded() : array<string|int, mixed>
Return values
array<string|int, mixed>isGuarded()
Determines if the given property is guarded.
public
isGuarded(string $property) : bool
Parameters
- $property : string
Return values
boolfillProperties()
Attempts to mass assign the given options to explicitly defined properties, skipping over any properties that are defined in the guarded array.
protected
fillProperties([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []