Laravel Rocket 聊天通知功能扩展包
Laravel  /  管理员 发布于 1年前   706
Laravel Rocket Chat Notifications 是一个使用 RocketChat 和 Laravel 9+ 轻松发送通知的软件包:
use Illuminate\Notifications\Notification;
use TeamNiftyGmbh\RocketChatNotifications\Channels\RocketChatNotificationChannel;
use TeamNiftyGmbh\RocketChatNotifications\Messages\RocketChatMessage;
class TaskCompleted extends Notification
{
public function via(mixed $notifiable): array
{
return [
RocketChatNotificationChannel::class
];
}
public function toRocketChat($notifiable): RocketChatMessage
{
return RocketChatMessage::create('Test Message');
}
}
Rocket Chat Message 类具有方便的方法来制定您的 RocketChat 消息。
以下是其中一些示例,包括添加附件:
public function toRocketChat($notifiable)
{
return RocketChatMessage::create('Test message')
// optional if set in config
->to('channel_name')
// optional if set in config
->from('access_token', 'rocket_chat_user_id')
->attachments([
RocketChatAttachment::create()
->imageUrl('test'),
RocketChatAttachment::create([
'image_url' => 'test'
]),
new RocketChatAttachment(['image_url' => 'test']),
// Or via array
[
'image_url' => 'test'
]
]);
}
有关所有内容的完整列表,您可以格式化消息,查看自述文件中的可用方法。
https://github.com/Team-Nifty-GmbH/laravel-rocket-chat-notifications/tree/be3e7a95653b3c737407e84175376efdcf2a7d99#available-methods
Rocket.Chat 是一个具有私人聊天、团队聊天等功能的通信平台,包括 SaaS 产品和自我管理安装的定价选项。
https://rocket.chat/
您可以了解有关此软件包的更多信息,获取完整的安装说明,并在 GitHub 上查看源代码。
https://github.com/Team-Nifty-GmbH/laravel-rocket-chat-notifications
转:
https://laravel-news.com/laravel-rocket-chat-notifications
原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..博主 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 @ mashrdn 多切换几个节点测试,免费ssr是没那么稳..Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号