0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravelのデフォルトのメーラーを取得する

Last updated at Posted at 2021-03-14

概要

config/mail.php で設定したメーラーにアクセスします。

環境

Laravel 7.x, 8.x で動作確認しています。

取得方法

app('mailer');

または

app('mail.manager')->driver();

または

app('mail.manager')->mailer();

どれも Illuminate\Mail\Mailer を返します。

また、デフォルト以外のメーラーは driver('ses') のように引数を与えると取得できます。

mail.manager について

app('mail.manager')Illuminate\Mail\MailManager を返します。

資料

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?