Skip to content

Instantly share code, notes, and snippets.

@maxwellimpact
Created March 7, 2016 05:16
Show Gist options
  • Save maxwellimpact/46ded5c553f68946d13d to your computer and use it in GitHub Desktop.
Save maxwellimpact/46ded5c553f68946d13d to your computer and use it in GitHub Desktop.
Sample service provider for extending Laravel's mail provider.
<?php
namespace App\Providers;
use Illuminate\Mail\MailServiceProvider;
class ExtendedMailServiceProvider extends MailServiceProvider
{
/**
* Extended register the Swift Transport instance.
*
* @return void
*/
protected function registerSwiftTransport()
{
parent::registerSwiftTransport();
app('swift.transport')->extend('spark', function($app)
{
return new \App\Mail\SparkPostTransport('theclient', 'thekey123');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment