Add params as type

This commit is contained in:
philipp lang 2023-06-07 21:39:57 +02:00 committed by Philipp Lang
parent 06d512e8ae
commit 68ecce179e
1 changed files with 1 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class StoreAction
'name' => 'required|string|max:255',
'domain' => 'required|string|max:255',
'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]),
];
}