sliverwing/laravel-dingtalk-bot-channel

此包使使用钉钉机器人发送通知变得简单

0.0.2 2017-11-02 15:39 UTC

This package is not auto-updated.

Last update: 2024-09-23 06:49:13 UTC


README

为 Laravel 添加钉钉机器人通道支持

支持的消息类型

  • 文本
  • 链接
  • Markdown
  • 操作卡
  • [] 账单卡

用法

  • 需要此包
composer require sliverwing/laravel-dingtalk-bot-channel
  • 将配置文件添加到您的项目中
# ./config/dingtalk.php
return [
    'bot' => [
        'token' => 'Your Token'
    ]
];
  • 更新您的通知文件
    // ...

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [DingtalkBotChannel::class];
    }
    
    // ...
    
    public function toDingTalkBot($notifiable)
    {
        return (new Message())
            ->text("Test Msg")
            ->at(['156xxxx8827', '189xxxx8325'], false);
    }
    
    // ...