for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sichikawa\LaravelSendgridDriver;
use GuzzleHttp\Client as HttpClient;
use Illuminate\Support\Arr;
use Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport;
use Sichikawa\LaravelSendgridDriver\Transport\SendgridV3Transport;
class TransportManager extends \Illuminate\Mail\TransportManager
{
/**
* Create an instance of the SendGrid Swift Transport driver.
*
* @return Transport\SendGridTransport
*/
protected function createSendgridDriver()
$config = $this->app['config']->get('services.sendgrid', array());
$client = new HttpClient(Arr::get($config, 'guzzle', []));
return new SendgridTransport($client, $config['api_key']);
}
* @return Transport\SendgridV3Transport
protected function createSendgridV3Driver()
$config = $this->app['config']->get('services.sendgrid', []);
$pretend = isset($config['pretend']) ? $config['pretend'] : false;
return new SendgridV3Transport($client, $config['api_key'], $pretend);