HidesAttributes
trait HidesAttributes (View source)
Properties
$hidden | The attributes that should be hidden for serialization. | ||
protected array | $visible | The attributes that should be visible in serialization. |
Methods
array | getHidden() Get the hidden attributes for the model. | |
$this | setHidden(array $hidden) Set the hidden attributes for the model. | |
array | getVisible() Get the visible attributes for the model. | |
$this | setVisible(array $visible) Set the visible attributes for the model. | |
$this | makeVisible(array|string|null $attributes) Make the given, typically hidden, attributes visible. | |
$this | makeVisibleIf(bool|Closure $condition, array|string|null $attributes) Make the given, typically hidden, attributes visible if the given truth test passes. | |
$this | makeHidden(array|string|null $attributes) Make the given, typically visible, attributes hidden. | |
$this | makeHiddenIf(bool|Closure $condition, array|string|null $attributes) Make the given, typically visible, attributes hidden if the given truth test passes. |
Details
array getHidden()
Get the hidden attributes for the model.
$this setHidden(array $hidden)
Set the hidden attributes for the model.
array getVisible()
Get the visible attributes for the model.
$this setVisible(array $visible)
Set the visible attributes for the model.
$this makeVisible(array|string|null $attributes)
Make the given, typically hidden, attributes visible.
$this makeVisibleIf(bool|Closure $condition, array|string|null $attributes)
Make the given, typically hidden, attributes visible if the given truth test passes.
$this makeHidden(array|string|null $attributes)
Make the given, typically visible, attributes hidden.
$this makeHiddenIf(bool|Closure $condition, array|string|null $attributes)
Make the given, typically visible, attributes hidden if the given truth test passes.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Database/Eloquent/Concerns/HidesAttributes.html