| 1 | <?php |
||
| 8 | class PostmarkServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Boot the service provider. |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | 31 | public function boot() |
|
| 16 | { |
||
| 17 | 31 | $this->publishes([ |
|
| 18 | 31 | __DIR__.'/../config/postmark.php' => config_path('postmark.php'), |
|
| 19 | 31 | ], 'config'); |
|
| 20 | |||
| 21 | 31 | if ($this->app['config']['mail.driver'] !== 'postmark') { |
|
| 22 | 1 | return; |
|
| 23 | } |
||
| 24 | |||
| 25 | 30 | $this->mergeConfigFrom(__DIR__.'/../config/postmark.php', 'postmark'); |
|
| 26 | |||
| 27 | 30 | $this->app['swift.transport']->extend('postmark', function () { |
|
| 28 | 30 | return new PostmarkTransport( |
|
| 29 | 30 | $this->guzzle(config('postmark.guzzle', [])), |
|
| 30 | 30 | config('postmark.secret', config('services.postmark.secret')) |
|
| 31 | ); |
||
| 32 | 30 | }); |
|
| 33 | 30 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get a fresh Guzzle HTTP client instance. |
||
| 37 | * |
||
| 38 | * @param array $config |
||
| 39 | * |
||
| 40 | * @return \GuzzleHttp\Client |
||
| 41 | */ |
||
| 42 | 30 | protected function guzzle($config) |
|
| 46 | } |
||
| 47 |