Auto-register leadmail mailer config at boot time

This commit is contained in:
netlas
2026-03-04 02:22:02 +02:00
parent 1b5fd82894
commit c1cab41019

View File

@@ -13,6 +13,10 @@ class LeadMailServiceProvider extends ServiceProvider
{ {
$this->mergeConfigFrom(__DIR__.'/../config/leadmail.php', 'leadmail'); $this->mergeConfigFrom(__DIR__.'/../config/leadmail.php', 'leadmail');
$this->app->booted(function () {
config(['mail.mailers.leadmail' => ['transport' => 'leadmail']]);
});
$this->app->singleton(LeadMailClient::class, function () { $this->app->singleton(LeadMailClient::class, function () {
return new LeadMailClient( return new LeadMailClient(
baseUrl: config('leadmail.url'), baseUrl: config('leadmail.url'),