Laravel 5.5随需应变的通知 [英] Laravel 5.5 On demand notification with slack

查看:86
本文介绍了Laravel 5.5随需应变的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此页面,我们可以按需发送通知无需通过模型.如何使用松弛来做同样的事情?

According to this page, we can send a notification on demand without going through a model. How do I do the same using slack?

我想做这样的事情:

$emailAddress = 'my email address';
Notification::route('mail', $emailAddress)
            ->route('slack', 'what do I put here?')
            ->notify(new TestNotification());

该代码无需slack行即可工作.

The code works without the slack line.

此StackOverflow问题使用按需方法

推荐答案

您应该输入Slack Webhook URL.请参阅: https://laravel.com/docs/5.5/notifications#routing-slack -通知

You should you put the Slack Webhook URL. See: https://laravel.com/docs/5.5/notifications#routing-slack-notifications

 Notification::route('slack', 'https://hooks.slack.com/services/ZZZZ/YYYY/XXX')->notify(new DailyStats());

这篇关于Laravel 5.5随需应变的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆