根据这一页 https://laravel.com/docs/5.5/notifications#on-demand-notifications,我们可以按需发送通知,而无需通过模型。我如何使用 slack 来做同样的事情?
我想做这样的事情:
$emailAddress = 'my email address';
Notification::route('mail', $emailAddress)
->route('slack', 'what do I put here?')
->notify(new TestNotification());
该代码无需slack
line.
Edit: 这个 StackOverflow 问题 https://stackoverflow.com/questions/46277323/laravel-testing-on-demand-notification使用按需方法
您应该输入 Slack Webhook URL。看:https://laravel.com/docs/5.5/notifications#routing-slack-notifications https://laravel.com/docs/5.5/notifications#routing-slack-notifications
Notification::route('slack', 'https://hooks.slack.com/services/ZZZZ/YYYY/XXX')->notify(new DailyStats());
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)