Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/Mail/MailManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
*/
class MailManager extends BaseMailManager
{
/*
* Get a mailer instance by name.
*
* @param string|null $name
* @return \Illuminate\Contracts\Mail\Mailer
*/
public function mailer($name = null)
{
/*
* Extensibility
*/
$this->app['events']->fire('mailer.beforeRegister', [$this]);

return parent::mailer($name);
}

/**
* Resolve the given mailer.
*
Expand All @@ -26,11 +42,6 @@ protected function resolve($name)
throw new InvalidArgumentException("Mailer [{$name}] is not defined.");
}

/*
* Extensibility
*/
$this->app['events']->fire('mailer.beforeRegister', [$this]);

// Once we have created the mailer instance we will set a container instance
// on the mailer. This allows us to resolve mailer classes via containers
// for maximum testability on said classes instead of passing Closures.
Expand Down