Add params as type
This commit is contained in:
parent
06d512e8ae
commit
68ecce179e
app/Mailgateway/Actions
|
@ -27,6 +27,7 @@ class StoreAction
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:255',
|
||||||
'domain' => 'required|string|max:255',
|
'domain' => 'required|string|max:255',
|
||||||
'type.cls' => ['required', 'string', 'max:255', Rule::in(app('mail-gateways'))],
|
'type.cls' => ['required', 'string', 'max:255', Rule::in(app('mail-gateways'))],
|
||||||
|
'type.params' => 'present|array',
|
||||||
...collect(request()->input('type.cls')::rules('storeValidator'))->mapWithKeys(fn ($rules, $key) => ["type.params.{$key}" => $rules]),
|
...collect(request()->input('type.cls')::rules('storeValidator'))->mapWithKeys(fn ($rules, $key) => ["type.params.{$key}" => $rules]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue