34 lines
792 B
PHP
34 lines
792 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\App;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class MailjetServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
// Mailjet client to call the API.
|
|
App::singleton('mailjetClient', function () {
|
|
$mailjetClient = new \Mailjet\Client(
|
|
config('services.mailjet.public'),
|
|
config('services.mailjet.secret'),
|
|
true,
|
|
[
|
|
'version' => 'v3',
|
|
]
|
|
);
|
|
|
|
$mailjetClient->setConnectionTimeout(200);
|
|
$mailjetClient->setTimeout(200);
|
|
|
|
return $mailjetClient;
|
|
});
|
|
}
|
|
}
|