HidesAttributes
trait HidesAttributes
Properties
| $hidden | The attributes that should be hidden for serialization. |
||
| protected array<int, string> | $visible | The attributes that should be visible in serialization. |
Methods
Initialize the HidesAttributes trait.
Get the hidden attributes for the model.
Set the hidden attributes for the model.
Merge new hidden attributes with existing hidden attributes on the model.
Get the visible attributes for the model.
Set the visible attributes for the model.
Merge new visible attributes with existing visible attributes on the model.
Make the given, typically hidden, attributes visible.
Make the given, typically hidden, attributes visible if the given truth test passes.
Make the given, typically visible, attributes hidden.
Make the given, typically visible, attributes hidden if the given truth test passes.
Details
at line 31
void
initializeHidesAttributes()
Initialize the HidesAttributes trait.
at line 43
array
getHidden()
Get the hidden attributes for the model.
at line 54
HidesAttributes
setHidden(array $hidden)
Set the hidden attributes for the model.
at line 67
HidesAttributes
mergeHidden(array $hidden)
Merge new hidden attributes with existing hidden attributes on the model.
at line 83
array
getVisible()
Get the visible attributes for the model.
at line 94
HidesAttributes
setVisible(array $visible)
Set the visible attributes for the model.
at line 107
HidesAttributes
mergeVisible(array $visible)
Merge new visible attributes with existing visible attributes on the model.
at line 124
HidesAttributes
makeVisible(array|string|null $attributes)
Make the given, typically hidden, attributes visible.
at line 143
HidesAttributes
makeVisibleIf(bool|Closure $condition, array|string|null $attributes)
Make the given, typically hidden, attributes visible if the given truth test passes.
at line 154
HidesAttributes
makeHidden(array|string|null $attributes)
Make the given, typically visible, attributes hidden.
at line 170
HidesAttributes
makeHiddenIf(bool|Closure $condition, array|string|null $attributes)
Make the given, typically visible, attributes hidden if the given truth test passes.