|
@@ -15,7 +15,7 @@ class CreateMailSettings extends SettingsMigration
|
|
|
$this->migrator->add('mail.mail_username', $table_exists ? $this->getOldValue('SETTINGS::MAIL:USERNAME') : env('MAIL_USERNAME', ''));
|
|
|
$this->migrator->addEncrypted('mail.mail_password', $table_exists ? $this->getOldValue('SETTINGS::MAIL:PASSWORD') : env('MAIL_PASSWORD', ''));
|
|
|
$this->migrator->add('mail.mail_encryption', $table_exists ? $this->getOldValue('SETTINGS::MAIL:ENCRYPTION') : env('MAIL_ENCRYPTION', 'tls'));
|
|
|
- $this->migrator->add('mail.mail_from_address', $table_exists ? $this->getOldValue('SETTINGS::MAIL:FROM_ADDRESS') : env('MAIL_FROM_ADDRESS', ''));
|
|
|
+ $this->migrator->add('mail.mail_from_address', $table_exists ? $this->getOldValue('SETTINGS::MAIL:FROM_ADDRESS') : env('MAIL_FROM_ADDRESS', 'example@example.com'));
|
|
|
$this->migrator->add('mail.mail_from_name', $table_exists ? $this->getOldValue('SETTINGS::MAIL:FROM_NAME') : env('APP_NAME', 'ControlPanel.gg'));
|
|
|
$this->migrator->add('mail.mail_mailer', $table_exists ? $this->getOldValue('SETTINGS::MAIL:MAILER') : env('MAIL_MAILER', 'smtp'));
|
|
|
$this->migrator->add('mail.mail_enabled', true);
|
|
@@ -28,6 +28,15 @@ class CreateMailSettings extends SettingsMigration
|
|
|
|
|
|
// Handle the old values to return without it being a string in all cases.
|
|
|
if ($old_value->type === "string" || $old_value->type === "text") {
|
|
|
+ if (is_null($old_value->value)) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+
|
|
|
+ // Some values have the type string, but their values are boolean.
|
|
|
+ if ($old_value->value === "false" || $old_value->value === "true") {
|
|
|
+ return filter_var($old_value->value, FILTER_VALIDATE_BOOL);
|
|
|
+ }
|
|
|
+
|
|
|
return $old_value->value;
|
|
|
}
|
|
|
|