File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,17 +38,7 @@ public function register()
3838 $ app ['view ' ], $ app ['swift.mailer ' ], $ app ['events ' ]
3939 );
4040
41- if ($ app ->bound ('log ' ))
42- {
43- $ mailer ->setLogger ($ app ['log ' ]);
44- }
45-
46- if ($ app ->bound ('queue ' ))
47- {
48- $ mailer ->setQueue ($ app ['queue ' ]);
49- }
50-
51- $ mailer ->setContainer ($ app );
41+ $ this ->setMailerDependencies ($ mailer , $ app );
5242
5343 // If a "from" address is set, we will set it on the mailer so that all mail
5444 // messages sent by the applications will utilize the same "from" address
@@ -71,6 +61,28 @@ public function register()
7161 });
7262 }
7363
64+ /**
65+ * Set a few dependencies on the mailer instance.
66+ *
67+ * @param \Illuminate\Mail\Mailer $mailer
68+ * @param \Illuminate\Foundation\Application $app
69+ * @return void
70+ */
71+ protected function setMailerDependencies ($ mailer , $ app )
72+ {
73+ $ mailer ->setContainer ($ app );
74+
75+ if ($ app ->bound ('log ' ))
76+ {
77+ $ mailer ->setLogger ($ app ['log ' ]);
78+ }
79+
80+ if ($ app ->bound ('queue ' ))
81+ {
82+ $ mailer ->setQueue ($ app ['queue ' ]);
83+ }
84+ }
85+
7486 /**
7587 * Register the Swift Mailer instance.
7688 *
You can’t perform that action at this time.
0 commit comments