trait HidesAttributes

Properties

protected array $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.

void
addHidden(array|string|null $attributes = null)

Add 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.

void
addVisible(array|string|null $attributes = null)

Add visible attributes for the model.

$this
makeVisible(array|string $attributes)

Make the given, typically hidden, attributes visible.

$this
makeHidden(array|string $attributes)

Make the given, typically visible, attributes hidden.

Details

at line 26
array getHidden()

Get the hidden attributes for the model.

Return Value

array

at line 38
$this setHidden(array $hidden)

Set the hidden attributes for the model.

Parameters

array $hidden

Return Value

$this

at line 52
void addHidden(array|string|null $attributes = null)

Add hidden attributes for the model.

Parameters

array|string|null $attributes

Return Value

void

at line 64
array getVisible()

Get the visible attributes for the model.

Return Value

array

at line 76
$this setVisible(array $visible)

Set the visible attributes for the model.

Parameters

array $visible

Return Value

$this

at line 90
void addVisible(array|string|null $attributes = null)

Add visible attributes for the model.

Parameters

array|string|null $attributes

Return Value

void

at line 104
$this makeVisible(array|string $attributes)

Make the given, typically hidden, attributes visible.

Parameters

array|string $attributes

Return Value

$this

at line 122
$this makeHidden(array|string $attributes)

Make the given, typically visible, attributes hidden.

Parameters

array|string $attributes

Return Value

$this