2019-12-31 08:59:12 +11:00
|
|
|
<?php
|
2019-12-04 15:52:04 +11:00
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use App\Helpers\Mail\GmailTransportManager;
|
|
|
|
|
use Illuminate\Mail\MailServiceProvider as MailProvider;
|
2021-02-10 22:34:39 +11:00
|
|
|
use Illuminate\Mail\TransportManager;
|
2019-12-04 15:52:04 +11:00
|
|
|
|
|
|
|
|
class MailServiceProvider extends MailProvider
|
|
|
|
|
{
|
2021-02-10 22:06:10 +11:00
|
|
|
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
2021-02-10 22:17:27 +11:00
|
|
|
$this->registerIlluminateMailer();
|
2021-02-10 22:06:10 +11:00
|
|
|
}
|
|
|
|
|
|
2021-02-10 22:34:39 +11:00
|
|
|
protected function registerIlluminateMailer()
|
2019-12-04 15:52:04 +11:00
|
|
|
{
|
2021-02-10 22:34:39 +11:00
|
|
|
$this->app->singleton('mail.manager', function($app) {
|
|
|
|
|
return new GmailTransportManager($app);
|
|
|
|
|
});
|
2021-02-10 22:06:10 +11:00
|
|
|
|
2021-02-11 10:38:42 +11:00
|
|
|
|
2021-02-10 22:34:39 +11:00
|
|
|
$this->app->bind('mailer', function ($app) {
|
|
|
|
|
return $app->make('mail.manager')->mailer();
|
2019-12-04 15:52:04 +11:00
|
|
|
});
|
|
|
|
|
}
|
2021-02-10 22:34:39 +11:00
|
|
|
|
2019-12-31 08:59:12 +11:00
|
|
|
}
|
2021-02-10 22:34:39 +11:00
|
|
|
|