Laravel 5.5带松弛的按需通知

时间:2018-01-16 09:39:42

标签: laravel-5.5 slack

根据this page,我们可以根据需要发送通知,而无需通过模型。如何使用松弛来做同样的事情?

我想做这样的事情:

func setHighlighted(_ highlighted: Bool, 
       animated: Bool)

代码在没有$emailAddress = 'my email address'; Notification::route('mail', $emailAddress) ->route('slack', 'what do I put here?') ->notify(new TestNotification()); 行的情况下工作。

编辑:this StackOverflow question使用点播方法

1 个答案:

答案 0 :(得分:7)

您应该放置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());
相关问题