File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -72,19 +72,6 @@ public function mailer($name = null)
72
72
return $ this ->mailers [$ name ] = $ this ->get ($ name );
73
73
}
74
74
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
-
88
75
/**
89
76
* Get a mailer driver instance.
90
77
*
@@ -453,6 +440,25 @@ public function setDefaultDriver(string $name)
453
440
$ this ->app ['config ' ]['mail.default ' ] = $ name ;
454
441
}
455
442
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
+
456
462
/**
457
463
* Register a custom transport creator Closure.
458
464
*
You can’t perform that action at this time.
0 commit comments