8000 fixes passing string arguments to tab/section visibility methods · laravel-enso/forms@249c240 · GitHub
[go: up one dir, main page]

Skip to content

Commit 249c240

Browse files
committed
fixes passing string arguments to tab/section visibility methods
1 parent 7c07453 commit 249c240

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Services/Form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,15 @@ public function labels(bool $labels): self
230230

231231
public function sectionVisibility($fields, bool $hidden): self
232232
{
233-
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
233+
Collection::wrap(is_string($fields) ? [$fields] : $fields)
234234
->each(fn ($field) => $this->section($field)->put('hidden', $hidden));
235235

236236
return $this;
237237
}
238238

239239
public function tabVisibility($tabs, bool $hidden): self
240240
{
241-
$tabs = Collection::wrap(is_string($tabs) ? func_get_args() : $tabs);
241+
$tabs = Collection::wrap(is_string($tabs) ? [$tabs] : $tabs);
242242

243243
$this->template->get('sections')->each(fn ($section) => $tabs->when(
244244
$tabs->contains($section->get('tab')),

0 commit comments

Comments
 (0)
0