1 | <?php |
||
5 | trait HidesAttributes |
||
6 | { |
||
7 | /** |
||
8 | * The attributes that should be hidden for serialization. |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $hidden = []; |
||
13 | |||
14 | /** |
||
15 | * The attributes that should be visible in serialization. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $visible = []; |
||
20 | |||
21 | /** |
||
22 | * Get the hidden attributes for the model. |
||
23 | * |
||
24 | * @return array |
||
25 | */ |
||
26 | public function getHidden() |
||
30 | |||
31 | /** |
||
32 | * Set the hidden attributes for the model. |
||
33 | * |
||
34 | * @param array $hidden |
||
35 | * @return $this |
||
36 | */ |
||
37 | public function setHidden(array $hidden) |
||
43 | |||
44 | /** |
||
45 | * Add hidden attributes for the model. |
||
46 | * |
||
47 | * @param array|string|null $attributes |
||
48 | * @return void |
||
49 | */ |
||
50 | public function addHidden($attributes = null) |
||
56 | |||
57 | /** |
||
58 | * Get the visible attributes for the model. |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | public function getVisible() |
||
66 | |||
67 | /** |
||
68 | * Set the visible attributes for the model. |
||
69 | * |
||
70 | * @param array $visible |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function setVisible(array $visible) |
||
79 | |||
80 | /** |
||
81 | * Add visible attributes for the model. |
||
82 | * |
||
83 | * @param array|string|null $attributes |
||
84 | * @return void |
||
85 | */ |
||
86 | public function addVisible($attributes = null) |
||
92 | |||
93 | /** |
||
94 | * Make the given, typically hidden, attributes visible. |
||
95 | * |
||
96 | * @param array|string $attributes |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function makeVisible($attributes) |
||
109 | |||
110 | /** |
||
111 | * Make the given, typically visible, attributes hidden. |
||
112 | * |
||
113 | * @param array|string $attributes |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function makeHidden($attributes) |
||
126 | } |
||
127 |