trait HidesAttributes (View source)

Properties

protected string[] $hidden

The attributes that should be hidden for serialization.

protected string[] $visible

The attributes that should be visible in serialization.

Methods

string[]
getHidden()

Get the hidden attributes for the model.

$this
setHidden(array $hidden)

Set the hidden attributes for the model.

string[]
getVisible()

Get the visible attributes for the model.

$this
setVisible(array $visible)

Set the visible attributes for the model.

$this
makeVisible(string[]|string|null $attributes)

Make the given, typically hidden, attributes visible.

$this
makeVisibleIf(bool|Closure $condition, string[]|string|null $attributes)

Make the given, typically hidden, attributes visible if the given truth test passes.

$this
makeHidden(string[]|string|null $attributes)

Make the given, typically visible, attributes hidden.

$this
makeHiddenIf(bool|Closure $condition, string[]|string|null $attributes)

Make the given, typically visible, attributes hidden if the given truth test passes.

Details

string[] getHidden()

Get the hidden attributes for the model.

Return Value

string[]

$this setHidden(array $hidden)

Set the hidden attributes for the model.

Parameters

array $hidden

Return Value

$this

string[] getVisible()

Get the visible attributes for the model.

Return Value

string[]

$this setVisible(array $visible)

Set the visible attributes for the model.

Parameters

array $visible

Return Value

$this

$this makeVisible(string[]|string|null $attributes)

Make the given, typically hidden, attributes visible.

Parameters

string[]|string|null $attributes

Return Value

$this

$this makeVisibleIf(bool|Closure $condition, string[]|string|null $attributes)

Make the given, typically hidden, attributes visible if the given truth test passes.

Parameters

bool|Closure $condition
string[]|string|null $attributes

Return Value

$this

$this makeHidden(string[]|string|null $attributes)

Make the given, typically visible, attributes hidden.

Parameters

string[]|string|null $attributes

Return Value

$this

$this makeHiddenIf(bool|Closure $condition, string[]|string|null $attributes)

Make the given, typically visible, attributes hidden if the given truth test passes.

Parameters

bool|Closure $condition
string[]|string|null $attributes

Return Value

$this