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 43
array getHidden()

Get the hidden attributes for the model.

Return Value

array

at line 54
HidesAttributes setHidden(array $hidden)

Set the hidden attributes for the model.

Parameters

array $hidden

Return Value

HidesAttributes

at line 67
HidesAttributes mergeHidden(array $hidden)

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

Parameters

array $hidden

Return Value

HidesAttributes

at line 83
array getVisible()

Get the visible attributes for the model.

Return Value

array

at line 94
HidesAttributes setVisible(array $visible)

Set the visible attributes for the model.

Parameters

array $visible

Return Value

HidesAttributes

at line 107
HidesAttributes mergeVisible(array $visible)

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

Parameters

array $visible

Return Value

HidesAttributes

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

Make the given, typically hidden, attributes visible.

Parameters

array|string|null $attributes

Return Value

HidesAttributes

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.

Parameters

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

Return Value

HidesAttributes

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

Make the given, typically visible, attributes hidden.

Parameters

array|string|null $attributes

Return Value

HidesAttributes

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.

Parameters

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

Return Value

HidesAttributes