From 249c240afbc4234f8e1a29b30574f60fb8c33321 Mon Sep 17 00:00:00 2001 From: Vlad Chiovianu Date: Tue, 12 Sep 2023 11:14:13 +0300 Subject: [PATCH] fixes passing string arguments to tab/section visibility methods --- src/Services/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Form.php b/src/Services/Form.php index d5f0f16..3316cf4 100644 --- a/src/Services/Form.php +++ b/src/Services/Form.php @@ -230,7 +230,7 @@ public function labels(bool $labels): self public function sectionVisibility($fields, bool $hidden): self { - Collection::wrap(is_string($fields) ? func_get_args() : $fields) + Collection::wrap(is_string($fields) ? [$fields] : $fields) ->each(fn ($field) => $this->section($field)->put('hidden', $hidden)); return $this; @@ -238,7 +238,7 @@ public function sectionVisibility($fields, bool $hidden): self public function tabVisibility($tabs, bool $hidden): self { - $tabs = Collection::wrap(is_string($tabs) ? func_get_args() : $tabs); + $tabs = Collection::wrap(is_string($tabs) ? [$tabs] : $tabs); $this->template->get('sections')->each(fn ($section) => $tabs->when( $tabs->contains($section->get('tab')),