Skip to content

Commit e978475

Browse files
committed
formatting and fixing
1 parent 52f1417 commit e978475

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/Illuminate/Mail/MailManager.php

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ public function mailer($name = null)
7272
return $this->mailers[$name] = $this->get($name);
7373
}
7474

75-
/**
76-
* Forget a mailer instance by name.
77-
*
78-
* @param string $name
79-
* @return void
80-
*/
81-
public function forgetMailer($name)
82-
{
83-
if(isset($this->mailers[$name])){
84-
unset($this->mailers[$name]);
85-
}
86-
}
87-
8875
/**
8976
* Get a mailer driver instance.
9077
*
@@ -453,6 +440,25 @@ public function setDefaultDriver(string $name)
453440
$this->app['config']['mail.default'] = $name;
454441
}
455442

443+
/**
444+
* Forget a mailer instance by name.
445+
*
446+
* @param array|string|null $name
447+
* @return void
448+
*/
449+
public function forgetMailer($name = null)
450+
{
451+
$name = $name ?? $this->getDefaultDriver();
452+
453+
foreach ((array) $name as $mailerName) {
454+
if (isset($this->mailers[$mailerName])) {
455+
unset($this->mailers[$mailerName]);
456+
}
457+
}
458+
459+
return $this;
460+
}
461+
456462
/**
457463
* Register a custom transport creator Closure.
458464
*

0 commit comments

Comments
 (0)