Skip to content

Commit 5aef528

Browse files
add validation
1 parent 98e9ef2 commit 5aef528

File tree

3 files changed

+49297
-1
lines changed

3 files changed

+49297
-1
lines changed

dist/js/field.js

Lines changed: 49278 additions & 1 deletion
Large diffs are not rendered by default.

resources/js/components/NestedFormField.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
<template>
22
<div class="relative">
3+
<help-text
4+
class="error-text mt-2 text-danger p-4"
5+
v-if="hasError"
6+
>
7+
{{ firstError }}
8+
</help-text>
9+
310
<template v-if="shouldDisplay()">
411
<template v-if="field.children.length > 0">
12+
513
<card
614
:class="{ 'overflow-hidden': field.panel && !index }"
715
:key="child.id || child.key"
@@ -11,6 +19,7 @@
1119
:child="child"
1220
:field="field"
1321
/>
22+
1423
<component
1524
:conditions="conditions"
1625
:errors="errors"

src/NestedForm.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,16 @@ public function min(int $min)
288288
return $this->returnContext;
289289
}
290290

291+
/**
292+
* Set custom validation rules.
293+
*/
294+
public function rules($rules)
295+
{
296+
parent::rules($rules);
297+
298+
return $this->returnContext;
299+
}
300+
291301
/**
292302
* Set the condition to display the form.
293303
*/

0 commit comments

Comments
 (0)