app: fix remaining email config keys
This commit is contained in:
parent
6377e3309a
commit
4626118d77
3 changed files with 10 additions and 10 deletions
|
@ -13,11 +13,11 @@ class MailSettingsFormRequest extends AdminFormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'mail:host' => 'required|string',
|
||||
'mail:port' => 'required|integer|between:1,65535',
|
||||
'mail:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])],
|
||||
'mail:username' => 'nullable|string|max:191',
|
||||
'mail:password' => 'nullable|string|max:191',
|
||||
'mail:mailers:smtp:host' => 'required|string',
|
||||
'mail:mailers:smtp:port' => 'required|integer|between:1,65535',
|
||||
'mail:mailers:smtp:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])],
|
||||
'mail:mailers:smtp:username' => 'nullable|string|max:191',
|
||||
'mail:mailers:smtp:password' => 'nullable|string|max:191',
|
||||
'mail:from:address' => 'required|string|email',
|
||||
'mail:from:name' => 'nullable|string|max:191',
|
||||
];
|
||||
|
@ -31,8 +31,8 @@ class MailSettingsFormRequest extends AdminFormRequest
|
|||
{
|
||||
$keys = array_flip(array_keys($this->rules()));
|
||||
|
||||
if (empty($this->input('mail:password'))) {
|
||||
unset($keys['mail:password']);
|
||||
if (empty($this->input('mail:mailers:smtp:password'))) {
|
||||
unset($keys['mail:mailers:smtp:password']);
|
||||
}
|
||||
|
||||
return $this->only(array_flip($keys));
|
||||
|
|
Reference in a new issue