根据此页面,我们可以根据需要发送通知,而无需通过模型.我如何使用松弛做同样的事情?
我想做这样的事情:
$emailAddress = 'my email address';
Notification::route('mail', $emailAddress)
->route('slack', 'what do I put here?')
->notify(new TestNotification());
Run Code Online (Sandbox Code Playgroud)
代码在没有slack
线的情况下工作.
编辑:此StackOverflow问题使用按需方法
您应该放置Slack Webhook URL.请参阅:https://laravel.com/docs/5.5/notifications#routing-slack-notifications
Notification::route('slack', 'https://hooks.slack.com/services/ZZZZ/YYYY/XXX')->notify(new DailyStats());
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1741 次 |
最近记录: |