44use Illuminate \Mail \Transport \LogTransportV2 ;
55use Illuminate \Support \Arr ;
66use Illuminate \Support \ServiceProvider ;
7- use Symfony \Component \HttpClient \HttpClient ;
8- use Symfony \Component \Mailer \Bridge \Mailgun \Transport \MailgunTransportFactory ;
7+ // use Symfony\Component\HttpClient\HttpClient;
8+ // use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
99use Symfony \Component \Mailer \Transport \Dsn ;
1010use Symfony \Component \Mailer \Transport \SendmailTransport ;
1111use Symfony \Component \Mailer \Transport \Smtp \EsmtpTransport ;
1212use Symfony \Component \Mailer \Transport \Smtp \EsmtpTransportFactory ;
1313use Symfony \Component \Mailer \Transport \Smtp \Stream \SocketStream ;
14- use Symfony \Contracts \HttpClient \HttpClientInterface ;
14+ // use Symfony\Contracts\HttpClient\HttpClientInterface;
1515
1616class MailServiceProvider extends ServiceProvider {
1717
@@ -102,9 +102,9 @@ public function registerSymfonyMailer(): void
102102 case 'mail ' :
103103 $ this ->registerMailTransport ($ config );
104104 break ;
105- case 'mailgun ' :
106- $ this ->registerMailgunTransport ($ config );
107- break ;
105+ // case 'mailgun':
106+ // $this->registerMailgunTransport($config);
107+ // break;
108108// case 'mandrill':
109109// $this->registerMandrillTransport($config);
110110// break;
@@ -192,24 +192,24 @@ protected function registerMailTransport(array $config): void
192192 * @param array $config
193193 * @return void
194194 */
195- protected function registerMailgunTransport (array $ config ): void
196- {
197- $ this ->app ->bindShared ('symfony.transport ' , function () use ($ config )
198- {
199- $ factory = new MailgunTransportFactory (null , $ this ->getHttpClient ($ config ));
200-
201- if (! isset ($ config ['secret ' ])) {
202- $ config = $ this ->app ['config ' ]->get ('services.mailgun ' , []);
203- }
204-
205- return $ factory ->create (new Dsn (
206- 'mailgun+ ' .($ config ['scheme ' ] ?? 'https ' ),
207- $ config ['endpoint ' ] ?? 'default ' ,
208- $ config ['secret ' ],
209- $ config ['domain ' ]
210- ));
211- });
212- }
195+ // protected function registerMailgunTransport(array $config): void
196+ // {
197+ // $this->app->bindShared('symfony.transport', function() use ($config)
198+ // {
199+ // $factory = new MailgunTransportFactory(null, $this->getHttpClient($config));
200+ //
201+ // if (! isset($config['secret'])) {
202+ // $config = $this->app['config']->get('services.mailgun', []);
203+ // }
204+ //
205+ // return $factory->create(new Dsn(
206+ // 'mailgun+'.($config['scheme'] ?? 'https'),
207+ // $config['endpoint'] ?? 'default',
208+ // $config['secret'],
209+ // $config['domain']
210+ // ));
211+ // });
212+ // }
213213
214214 /**
215215 * Register the "Log" Symfony Transport instance.
@@ -222,23 +222,23 @@ protected function registerLogTransport(array $config): void
222222 $ this ->app ->bindShared ('symfony.transport ' , fn ($ app ) => new LogTransportV2 ($ app ->make ('Psr\Log\LoggerInterface ' )));
223223 }
224224
225- /**
226- * Get a configured Symfony HTTP client instance.
227- *
228- * @return \Symfony\Contracts\HttpClient\HttpClientInterface|null
229- */
230- protected function getHttpClient (array $ config ): ?HttpClientInterface
231- {
232- $ clientOptions = $ config ['client ' ] ?? false ;
233- if ($ clientOptions ) {
234- $ maxHostConnections = Arr::pull ($ clientOptions , 'max_host_connections ' , 6 );
235- $ maxPendingPushes = Arr::pull ($ clientOptions , 'max_pending_pushes ' , 50 );
236-
237- return HttpClient::create ($ clientOptions , $ maxHostConnections , $ maxPendingPushes );
238- }
239-
240- return null ;
241- }
225+ // /**
226+ // * Get a configured Symfony HTTP client instance.
227+ // *
228+ // * @return \Symfony\Contracts\HttpClient\HttpClientInterface|null
229+ // */
230+ // protected function getHttpClient(array $config): ?HttpClientInterface
231+ // {
232+ // $clientOptions = $config['client'] ?? false;
233+ // if ($clientOptions) {
234+ // $maxHostConnections = Arr::pull($clientOptions, 'max_host_connections', 6);
235+ // $maxPendingPushes = Arr::pull($clientOptions, 'max_pending_pushes', 50);
236+ //
237+ // return HttpClient::create($clientOptions, $maxHostConnections, $maxPendingPushes);
238+ // }
239+ //
240+ // return null;
241+ // }
242242
243243 /**
244244 * Get the services provided by the provider.
0 commit comments