trait
Illuminate
/
Database
/
Eloquent
/
Concerns
/
HidesAttributes
You are viewing an older version of the documentation. For the latest, please visit master documentation.
HidesAttributes
Properties
protected
$hidden array
The attributes that should be hidden for serialization.
Default: []
protected
$visible array
The attributes that should be visible in serialization.
Default: []
Methods
public
getHidden ( ) : array
Get the hidden attributes for the model.
public
setHidden ( array $hidden ) : $this
Set the hidden attributes for the model.
Parameters
- $hidden array
public
getVisible ( ) : array
Get the visible attributes for the model.
public
setVisible ( array $visible ) : $this
Set the visible attributes for the model.
Parameters
- $visible array
public
makeVisible ( $attributes ) : $this
Make the given, typically hidden, attributes visible.
Parameters
- $attributes array|string|null
public
makeVisibleIf ( $condition , $attributes ) : $this
Make the given, typically hidden, attributes visible if the given truth test passes.
Parameters
- $condition bool|Closure
- $attributes array|string|null
public
makeHidden ( $attributes ) : $this
Make the given, typically visible, attributes hidden.
Parameters
- $attributes array|string|null
public
makeHiddenIf ( $condition , $attributes ) : $this
Make the given, typically visible, attributes hidden if the given truth test passes.
Parameters
- $condition bool|Closure
- $attributes array|string|null