简体   繁体   English

Laravel Slack文档?

[英]Laravel Slack documentation?

I've read the page about the new notifications in Laravel 5.3, and seen some tutorials from Laracasts, but I would like to know what is available in terms of variables etc. 我已经阅读了有关Laravel 5.3中新通知的页面,并查看了Laracasts的一些教程,但是我想知道在变量等方面可用的内容。

In the Slack API documentation, I can see that I can create buttons in the notification, however, the notification (using SlackMessage) shows that I can't use action() and it throws 在Slack API文档中,我可以看到可以在通知中创建按钮,但是,通知(使用SlackMessage)表明我不能使用action()并抛出

Error 错误

Call to undefined method Illuminate\\Notifications\\Messages\\SlackMessage::action() 调用未定义的方法Illuminate \\ Notifications \\ Messages \\ SlackMessage :: action()

Does anyone have some information about this? 有人知道这件事吗?

Thanks in advance! 提前致谢!

What I think is you are reading the documentation wrongly. 我认为您是错误地阅读了文档。 According to Laravel's Slack Notification , it doesn't help you create "button" in Slack. 根据Laravel的Slack Notification ,它并不能帮助您在Slack中创建“按钮”。

The Laravel Notification is a mechanism for you to create notification through different channels, like SMS (Nexmo), Database, Emails, Slack. Laravel Notification是一种用于通过不同渠道(例如SMS(Nexmo),数据库,电子邮件,Slack)创建通知的机制。 So if you think about this carefully, "button" is actually not a common pattern in these channels, hence action is not implemented here in Slack. 因此,如果仔细考虑一下,“按钮”实际上并不是这些通道中的常见模式,因此在Slack中未实现action

In contract, the action method found in SimpleMessage or MailMessage is actually referring to "call-to- action " button. 在合同中, action中发现的方法SimpleMessageMailMessage实际上是指“呼叫TO- 动作 ”按钮。 It helps you create a button in the email nicely. 它可以帮助您在电子邮件中很好地创建一个按钮。 This is not true in other type of notifications, such as DatabaseMessage , NexmoMessage , or SlackMessage . 在其他类型的通知(例如DatabaseMessageNexmoMessageSlackMessage ,情况NexmoMessage SlackMessage You simply don't (or doesn't make sense) to create buttons in these channels. 您根本没有(或没有任何意义)在这些通道中创建按钮。

If you need to create additional content with SlackMessage , simply extend it and build one for your own. 如果您需要使用SlackMessage创建其他内容,只需对其进行扩展并自己构建一个即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM