8000 Merge branch 'master' into upgrade/enso6 · laravel-enso/forms@b358537 · GitHub
[go: up one dir, main page]

Skip to content

Commit b358537

Browse files
committed
Merge branch 'master' into upgrade/enso6
2 parents 3596ddd + 7c07453 commit b358537

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/Attributes/Meta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Meta
1111
'hidden', 'source', 'format', 'altFormat', 'time', 'rows', 'placeholder', 'trackBy',
1212
'label', 'tooltip', 'symbol', 'precision', 'thousand', 'decimal', 'positive', 'negative',
1313
'zero', 'resize', 'translated', 'time12hr', 'disable-clear', 'objects', 'toolbar',
14-
'plugins', 'taggable', 'searchMode',
14+
'plugins', 'taggable', 'searchMode', 'params', 'pivotParams', 'customParams',
1515
];
1616

1717
public const Types = [

src/Services/Form.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public function edit(Model $model): Obj
5757

5858
public function actions($actions): self
5959
{
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));
6163

6264
return $this;
6365
}
@@ -125,7 +127,7 @@ public function columns(string $field, int $value): self
125127

126128
public function hide($fields): self
127129
{
128-
Collection::wrap($fields)
130+
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
129131
->each(fn ($field) => $this->field($field)
130132
->get('meta')->set('hidden', true));
131133

@@ -162,7 +164,7 @@ public function showTab($tabs): self
162164

163165
public function show($fields): self
164166
{
165-
Collection::wrap($fields)
167+
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
166168
->each(fn ($field) => $this->field($field)
167169
->get('meta')->set('hidden', false));
168170

@@ -171,7 +173,7 @@ public function show($fields): self
171173

172174
public function disable($fields): self
173175
{
174-
Collection::wrap($fields)
176+
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
175177
->each(fn ($field) => $this->field($field)
176178
->get('meta')->set('disabled', true));
177179

@@ -180,7 +182,7 @@ public function disable($fields): self
180182

181183
public function readonly($fields): self
182184
{
183-
Collection::wrap($fields)
185+
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
184186
->each(fn ($field) => $this->field($field)
185187
->get('meta')->set('readonly', true));
186188

@@ -228,15 +230,15 @@ public function labels(bool $labels): self
228230

229231
public function sectionVisibility($fields, bool $hidden): self
230232
{
231-
Collection::wrap($fields)
233+
Collection::wrap(is_string($fields) ? func_get_args() : $fields)
232234
->each(fn ($field) => $this->section($field)->put('hidden', $hidden));
233235

234236
return $this;
235237
}
236238

237239
public function tabVisibility($tabs, bool $hidden): self
238240
{
239-
$tabs = new Collection($tabs);
241+
$tabs = Collection::wrap(is_string($tabs) ? func_get_args() : $tabs);
240242

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

0 commit comments

Comments
 (0)
0