@@ -57,7 +57,9 @@ public function edit(Model $model): Obj
57
57
58
58
public function actions ($ actions ): self
59
59
{
60
- $ this ->template ->set ('actions ' , new Obj ($ actions ));
60
+ $ args = Obj::wrap (is_string ($ actions ) ? func_get_args () : $ actions );
61
+
62
+ $ this ->template ->set ('actions ' , new Obj ($ args ));
61
63
62
64
return $ this ;
63
65
}
@@ -125,7 +127,7 @@ public function columns(string $field, int $value): self
125
127
126
128
public function hide ($ fields ): self
127
129
{
128
- Collection::wrap ($ fields )
130
+ Collection::wrap (is_string ( $ fields ) ? func_get_args () : $ fields )
129
131
->each (fn ($ field ) => $ this ->field ($ field )
130
132
->get ('meta ' )->set ('hidden ' , true ));
131
133
@@ -162,7 +164,7 @@ public function showTab($tabs): self
162
164
163
165
public function show ($ fields ): self
164
166
{
165
- Collection::wrap ($ fields )
167
+ Collection::wrap (is_string ( $ fields ) ? func_get_args () : $ fields )
166
168
->each (fn ($ field ) => $ this ->field ($ field )
167
169
->get ('meta ' )->set ('hidden ' , false ));
168
170
@@ -171,7 +173,7 @@ public function show($fields): self
171
173
172
174
public function disable ($ fields ): self
173
175
{
174
- Collection::wrap ($ fields )
176
+ Collection::wrap (is_string ( $ fields ) ? func_get_args () : $ fields )
175
177
->each (fn ($ field ) => $ this ->field ($ field )
176
178
->get ('meta ' )->set ('disabled ' , true ));
177
179
@@ -180,7 +182,7 @@ public function disable($fields): self
180
182
181
183
public function readonly ($ fields ): self
182
184
{
183
- Collection::wrap ($ fields )
185
+ Collection::wrap (is_string ( $ fields ) ? func_get_args () : $ fields )
184
186
->each (fn ($ field ) => $ this ->field ($ field )
185
187
->get ('meta ' )->set ('readonly ' , true ));
186
188
@@ -228,15 +230,15 @@ public function labels(bool $labels): self
228
230
229
231
public function sectionVisibility ($ fields , bool $ hidden ): self
230
232
{
231
- Collection::wrap ($ fields )
233
+ Collection::wrap (is_string ( $ fields ) ? func_get_args () : $ fields )
232
234
->each (fn ($ field ) => $ this ->section ($ field )->put ('hidden ' , $ hidden ));
233
235
234
236
return $ this ;
235
237
}
236
238
237
239
public function tabVisibility ($ tabs , bool $ hidden ): self
238
240
{
239
- $ tabs = new Collection ( $ tabs );
241
+ $ tabs = Collection:: wrap ( is_string ( $ tabs ) ? func_get_args () : $ tabs );
240
242
241
243
$ this ->template ->get ('sections ' )->each (fn ($ section ) => $ tabs ->when (
242
244
$ tabs ->contains ($ section ->get ('tab ' )),
0 commit comments