Download the PHP package wantp/laravel-dingtalk-notification-channel without Composer
On this page you can find all versions of the php package wantp/laravel-dingtalk-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wantp/laravel-dingtalk-notification-channel
More information about wantp/laravel-dingtalk-notification-channel
Files in wantp/laravel-dingtalk-notification-channel
Package laravel-dingtalk-notification-channel
Short Description Ding talk Notification Channel for laravel.
License MIT
Informations about the package laravel-dingtalk-notification-channel
Laravel-dingtalk-notification-channel
Laravel消息通知的钉钉通知扩展包
Require
- Laravel > 5.8
- PHP > 7.1
Install
Usage
发布配置文件,会发布配置文件app/dingtalk.php
钉钉通知配置
.env
格式化钉钉通知
如果要支持钉钉通知,那么你需要在通知类上定义一个via和一个toDingTalk 方法。via方法返回通知channel, toDingTalk方法接收一个 $notifiable 实体并返回 Wantp\Notifications\Messages\DingTalkMessage 实例。
app/Notifications/YourNotification.php
钉钉通知路由
使用 dingtalk 通道发送通知的时候,需要在实体上定义一个 routeNotificationForDingTalk 方法,
该方法返回钉钉的user_id。
以下示例是DingTalkUser模型记录了钉钉的user_id,User模型关联DingTalkUser并通过
routeNotificationForDingTalk方法返回user对应的钉钉user_id,这只是一个示例,你可以定义自己的实现。
发送钉钉通知
发送钉钉通知给多个用户
自定义发送通知路由,可发送钉钉通知给不在系统中的用户
link类型通知
内置了markdown(默认)和link类型的通知,使用link方法定义link类型通知 app/Notifications/YourNotification.php
dingtalk channel和其他channel的使用几乎没有什么不同,其他用法请参考Laravel文档
License
The code for laravel-dingtalk-notification-channel is distributed under the terms of the MIT license (see LICENSE).
All versions of laravel-dingtalk-notification-channel with dependencies
guzzlehttp/guzzle Version ^6.0
illuminate/notifications Version ~5.8.0|^6.0