Fix error handling for mailgateway forms
This commit is contained in:
parent
e5b2e1799f
commit
612b782c9b
|
@ -36,7 +36,7 @@ class Form extends Component
|
||||||
'type' => 'Typ',
|
'type' => 'Typ',
|
||||||
'name' => 'Beschreibung',
|
'name' => 'Beschreibung',
|
||||||
'domain' => 'Domain',
|
'domain' => 'Domain',
|
||||||
...$this->type ? collect($this->type::fieldNames())->mapWithKeys(fn ($attribute, $key) => ["params.{$key}" => $attribute]) : [],
|
...$this->type ? collect($this->type::fieldNames())->mapWithKeys(fn ($attribute, $key) => ["type.{$key}" => $attribute]) : [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ class Form extends Component
|
||||||
<x-form::select name="typeClass" wire:model.live="typeClass" label="Typ" :options="$types" required />
|
<x-form::select name="typeClass" wire:model.live="typeClass" label="Typ" :options="$types" required />
|
||||||
@foreach($this->fields() as $index => $field)
|
@foreach($this->fields() as $index => $field)
|
||||||
<x-form::text
|
<x-form::text
|
||||||
wire:key="index"
|
wire:key="$index"
|
||||||
wire:model="type.{{$field['name']}}"
|
wire:model="type.{{$field['name']}}"
|
||||||
:label="$field['label']"
|
:label="$field['label']"
|
||||||
:type="$field['type']"
|
:type="$field['type']"
|
||||||
:name="$field['name']"
|
:name="'type.'.$field['name']"
|
||||||
:required="str_contains('required', $field['validator'])"
|
:required="str_contains('required', $field['validator'])"
|
||||||
></x-form::text>
|
></x-form::text>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
Loading…
Reference in New Issue