LoginSignup
1
1

More than 3 years have passed since last update.

Laravel5.5でNotificationを指定のメールアドレスに送信したい

Last updated at Posted at 2019-09-26

Laravel5.5で普通にNotificationを使う場合

$user->notify(new InvoicePaid($invoice));

または

Notification::send($user, new InvoicePaid($invoice));

こんな感じのコードを書くと思います。

がUser情報を取得せずにNotificationを実施する方法がありました。

公式ドキュメントにそのままですが、気が付かなかった。

指定のメールアドレスに送信

Notification::route('mail', 'taylor@example.com')
            ->notify(new InvoicePaid($invoice));

参考

Laravel5.5公式ドキュメント

1
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
1
1