10000 adds clearErrorsControl structure option · laravel-enso/forms@93d0b48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93d0b48

Browse files
committed
adds clearErrorsControl structure option
1 parent c2ba968 commit 93d0b48

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Attributes/Structure.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ class Structure
77
public const Mandatory = ['method', 'sections', 'routeParams'];
88

99
public const Optional = [
10-
'title', 'icon', 'routePrefix', 'routes', 'actions', 'autosave', 'debounce',
11-
'authorize', 'params', 'dividerTitlePlacement', 'tabs', 'labels',
10+
'actions', 'authorize', 'autosave', 'clearErrorsControl', 'debounce',
11+
'dividerTitlePlacement', 'icon', 'labels', 'params', 'routePrefix',
12+
'routes', 'tabs', 'title',
1213
];
1314

1415
public const SectionMandatory = ['columns', 'fields'];

src/Services/Builder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(Obj $template, Collection $dirty, ?Model $model = nu
2626

2727
public function run(): void
2828
{
29-
$this->appendConfigParams()
29+
$this->appendParams()
3030
->values()
3131
->computeActions()
3232
->computeMetas();
@@ -212,7 +212,7 @@ private function actionConfig($action): array
212212
];
213213
}
214214

215-
private function appendConfigParams(): self
215+
private function appendParams(): self
216216
{
217217
if (! $this->template->has('authorize')) {
218218
$this->template->set('authorize', config('enso.forms.authorize'));
@@ -227,6 +227,10 @@ private function appendConfigParams(): self
227227
$this->template->set('labels', config('enso.forms.labels'));
228228
}
229229

230+
if (! $this->template->has('clearErrorsControl')) {
231+
$this->template->set('clearErrorsControl', true);
232+
}
233+
230234
return $this;
231235
}
232236

0 commit comments

Comments
 (0)
0