Send Notifications to Anyone

You can send Laravel Notifications not only to a certain user with $user->notify(), but also to anyone you want, via Notification::route(), with so-called "on-demand" notifications:

1Notification::route('mail', 'taylor@example.com')
2 ->route('nexmo', '5555555555')
3 ->route('slack', 'https://hooks.slack.com/services/...')
4 ->notify(new InvoicePaid($invoice));

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord