Skip to content

Commit 4626118

Browse files
committed
app: fix remaining email config keys
1 parent 6377e33 commit 4626118

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/Http/Controllers/Admin/Settings/MailController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public function update(MailSettingsFormRequest $request): Response
5757
}
5858

5959
$values = $request->normalize();
60-
if (array_get($values, 'mail:password') === '!e') {
61-
$values['mail:password'] = '';
60+
if (array_get($values, 'mail:mailers:smtp:password') === '!e') {
61+
$values['mail:mailers:smtp:password'] = '';
6262
}
6363

6464
foreach ($values as $key => $value) {

app/Http/Requests/Admin/Settings/MailSettingsFormRequest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class MailSettingsFormRequest extends AdminFormRequest
1313
public function rules(): array
1414
{
1515
return [
16-
'mail:host' => 'required|string',
17-
'mail:port' => 'required|integer|between:1,65535',
18-
'mail:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])],
19-
'mail:username' => 'nullable|string|max:191',
20-
'mail:password' => 'nullable|string|max:191',
16+
'mail:mailers:smtp:host' => 'required|string',
17+
'mail:mailers:smtp:port' => 'required|integer|between:1,65535',
18+
'mail:mailers:smtp:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])],
19+
'mail:mailers:smtp:username' => 'nullable|string|max:191',
20+
'mail:mailers:smtp:password' => 'nullable|string|max:191',
2121
'mail:from:address' => 'required|string|email',
2222
'mail:from:name' => 'nullable|string|max:191',
2323
];
@@ -31,8 +31,8 @@ public function normalize(array $only = null): array
3131
{
3232
$keys = array_flip(array_keys($this->rules()));
3333

34-
if (empty($this->input('mail:password'))) {
35-
unset($keys['mail:password']);
34+
if (empty($this->input('mail:mailers:smtp:password'))) {
35+
unset($keys['mail:mailers:smtp:password']);
3636
}
3737

3838
return $this->only(array_flip($keys));

app/Providers/SettingsServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SettingsServiceProvider extends ServiceProvider
5151
* configuration array.
5252
*/
5353
protected static array $encrypted = [
54-
'mail:password',
54+
'mail:mailers:smtp:password',
5555
];
5656

5757
/**

0 commit comments

Comments
 (0)