Skip to content

Instantly share code, notes, and snippets.

@taylorotwell
Last active December 17, 2018 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taylorotwell/2a0934fcd5bb59e74640c9e451e69ec4 to your computer and use it in GitHub Desktop.
Save taylorotwell/2a0934fcd5bb59e74640c9e451e69ec4 to your computer and use it in GitHub Desktop.
<?php
$this->app->singleton('mailer', function ($app) {
$config = $app->make('config')->get('mail');
$mailer = new Mailer(
$app['view'], $app['swift.mailer'], $app['events']
);
if ($app->bound('queue')) {
$mailer->setQueue($app['queue']);
}
// ...
return $mailer;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment