Replies: 1 comment 1 reply
-
Hi, I'm new to Laravel... I had to deal with this issue while deploying a "skeleton" app via Coolify, and during the deployment process, without access to the db the app doesn't deploy correctly. So I could adopt your solution to decouple my settings from the db. Now that the laravel-settings package is at version 3.4.4 and the PR you mentioned has been merged, it's not clear to me what interventions I should do on my code to benefit from it. Could you elaborate on the topic if you have the opportunity? Thanks in advance. Now i've in my app: namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class MailSettings extends Settings
{
public string $host = '';
public int $port = 0;
public string $encryption = '';
public string $username = '';
public string $password = '';
public string $from_address = '';
public string $from_name = '';
public static function group(): string
{
return 'mail';
}
} Previously in AppServiceProvider i had following code caused deplyment failure public function boot(): void
{
//
// Initialize mail settings
$mailSettings = app(MailSettings::class);
$mailHost = $mailSettings->host;
$mailPort = $mailSettings->port;
$mailEncryption = $mailSettings->encryption;
$mailUsername = $mailSettings->username;
$mailPassword = $mailSettings->password;
$mailFromAddress = $mailSettings->from_address;
$mailFromName = $mailSettings->from_name;
config([
'mail.host' => $mailHost,
'mail.port' => $mailPort,
'mail.encryption' => $mailEncryption,
'mail.username' => $mailUsername,
'mail.password' => $mailPassword,
'mail.from.address' => $mailFromAddress,
'mail.from.name' => $mailFromName,
]);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Recently I encountered a problem that I described in #307. With a Trick, I can solve this issue. You can read it on medium.com
Special thanks to @gazben for contributing PR #298
Beta Was this translation helpful? Give feedback.
All reactions