trait HidesAttributes

Properties

protected array<int, string> $hidden

The attributes that should be hidden for serialization.

protected array<int, string> $visible

The attributes that should be visible in serialization.

Methods

void
initializeHidesAttributes()

Initialize the HidesAttributes trait.

array
getHidden()

Get the hidden attributes for the model.

setHidden(array $hidden)

Set the hidden attributes for the model.

mergeHidden(array $hidden)

Merge new hidden attributes with existing hidden attributes on the model.

array
getVisible()

Get the visible attributes for the model.

setVisible(array $visible)

Set the visible attributes for the model.

mergeVisible(array $visible)

Merge new visible attributes with existing visible attributes on the model.

makeVisible(array|string|null $attributes)

Make the given, typically hidden, attributes visible.

makeVisibleIf(bool|Closure $condition, array|string|null $attributes)

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

makeHidden(array|string|null $attributes)

Make the given, typically visible, attributes hidden.

makeHiddenIf(bool|Closure $condition, array|string|null $attributes)

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

Details

at line 31
void initializeHidesAttributes()

Initialize the HidesAttributes trait.

Return Value

void

at line 47
array getHidden()

Get the hidden attributes for the model.

Return Value

array

at line 58
HidesAttributes setHidden(array $hidden)

Set the hidden attributes for the model.

Parameters

array $hidden

Return Value

HidesAttributes

at line 71
HidesAttributes mergeHidden(array $hidden)

Merge new hidden attributes with existing hidden attributes on the model.

Parameters

array $hidden

Return Value

HidesAttributes

at line 87
array getVisible()

Get the visible attributes for the model.

Return Value

array

at line 98
HidesAttributes setVisible(array $visible)

Set the visible attributes for the model.

Parameters

array $visible

Return Value

HidesAttributes

at line 111
HidesAttributes mergeVisible(array $visible)

Merge new visible attributes with existing visible attributes on the model.

Parameters

array $visible

Return Value

HidesAttributes

at line 128
HidesAttributes makeVisible(array|string|null $attributes)

Make the given, typically hidden, attributes visible.

Parameters

array|string|null $attributes

Return Value

HidesAttributes

at line 147
HidesAttributes makeVisibleIf(bool|Closure $condition, array|string|null $attributes)

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

Parameters

bool|Closure $condition
array|string|null $attributes

Return Value

HidesAttributes

at line 158
HidesAttributes makeHidden(array|string|null $attributes)

Make the given, typically visible, attributes hidden.

Parameters

array|string|null $attributes

Return Value

HidesAttributes

at line 174
HidesAttributes makeHiddenIf(bool|Closure $condition, array|string|null $attributes)

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

Parameters

bool|Closure $condition
array|string|null $attributes

Return Value

HidesAttributes