PHPackages                             pl1998/dingtalk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pl1998/dingtalk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pl1998/dingtalk
===============

这是一个钉钉tool

1.0.2(5y ago)01.2kPHPPHP ^7.1.3|^8.0

Since Jan 6Pushed 5y agoCompare

[ Source](https://github.com/pl1998/DingTalk)[ Packagist](https://packagist.org/packages/pl1998/dingtalk)[ RSS](/packages/pl1998-dingtalk/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

DingTalk 一个钉钉机器人与工作消息提醒的工具
==========================

[](#dingtalk-一个钉钉机器人与工作消息提醒的工具)

环境要求
====

[](#环境要求)

```
php:>7.1,
laravel:>5.5

```

详细使用请阅读 [钉钉开发文档](https://ding-doc.dingtalk.com/doc#/serverapi2/gh60vz)

安装
==

[](#安装)

`composer require thinkcar/dingtalk`
------------------------------------

[](#composer-require-thinkcardingtalk)

`php artisan vendor:publish --provider="ThinkCar\DingTalk\DingTalkServiceProvider"`

机器人
===

[](#机器人)

消息类型
----

[](#消息类型)

1. text
2. link
3. markdown
4. ActionCard
5. FeedCard

text
----

[](#text)

```
use ThinkCar\DingTalk\Facades\Robot;
use ThinkCar\DingTalk\Robot\Message\Text;
$text = new Text;
$text->content = '这是发送内容';
$text->At('123232321'); //表示@123232321
$text->addContent("为hello world!") // 将会与上面的内容拼接
$text->At("13911111111");//还可以继续@用户 addContent() 和At() 支持链式调用;
$response = Robot::push($text);
//判断消息是否推送成功
$response->isSuccess():bool;
//获取返回的数据结果
$response->getOrigin();
```

---

或者你也可以这样

```
    $text = new Text('这是发送内容');
    Robot::push($text); // or  app('ding.robot')->push($text);
```

link
----

[](#link)

```
    $link = new Link();
    $link->title = '连接的标题';
    $link->text = '即将到来的新版本';
    $link->messageUrl = 'https://mythinkcar.cn';
    $response = app('ding.robot')->push($link);
```

Markdown
--------

[](#markdown)

```
    $markdown = new Markdown();
    $markdown->title = '这是markdown标题';
    $markdown->text = '![](https://www.mythinkcar.cn/Home/img/binner1-4.jpg)
 ### 我就是我不一样的烟火
 ';
    // @18612345678 的用户, 第二个参数，与你的消息内容字段一致，第三个参数为true和false，默认false, true:表示@所有人,false:表示不@所有人
    $markdown->At('18612345678','text');
    $markdown->addContent("我的小可爱",'text'); //同text 支持链式调用，第二个参数为发送内容的字段名称
    app('ding.robot')->push($markdown);
```

ActionCard
----------

[](#actioncard)

```
    $card = new ActionCard();
    $card->title = '这是标题';
        $card->text = '![](https://www.mythinkcar.cn/Home/img/binner1-4.jpg)
 ### 乔布斯 20 年前想打造的苹果咖啡厅
 Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划';
    $card->singleTitle = '阅读全文';
    $card->singleURL = 'https://www.dingtalk.com/';

    app('ding.robot')->push($card);
```

FeedCard
--------

[](#feedcard)

```
    $card = new FeedCard();
    $card->addLink([  //添加按钮
        'title' => '我就是我不一样的烟火1',
        'messageURL' => 'https://mythinkcar.cn',
        'picURL' => 'https://www.mythinkcar.cn/Home/img/binner1-4.jpg'
    ])->addLink([
        'title' => '我就是我不一样的烟火2',
        'messageURL' => 'https://mythinkcar.cn',
        'picURL' => 'https://www.mythinkcar.cn/Home/img/binner1-4.jpg'
    ]);
    $response = app('robot')->push($card);

```

工作消息
====

[](#工作消息)

消息类型
----

[](#消息类型-1)

1. text

> 不支持@

2. image
3. voice
4. link
5. oa
6. markdown

> 不支持@

7. ActionCard

Oa 消息
-----

[](#oa-消息)

```
    $oa = new Oa();
    $oa->message_url = 'https://www.dingtalk.com/';
    $oa->pc_message_url = 'https://www.dingtalk.com/';
    $oa->file_count = 0;
    $oa->head = [
        'bgcolor' => 'FFBBBBBB',
        'text' => '腾讯科技',
    ];
    $oa->body = [
        'title' => '这是正文，请向下阅读',
        'form' => [
            [
                'key' => '姓名',
                'value' => 'supper Pan'
            ]
        ],
        'rich' => [
            'num' => 1,
            'unit' => '篇'
        ],
        'content' => 'wwwwwwww',
        'file_count' => 0,
        'author' => 'pan zhang yi',
    ];

    $oa->addReceivers(['userid']); //添加收件人
    $oa->addReceivers('userid');//效果同上,
    $oa->addReceivers('userid1','userid2','userid3');//效果同上,
    $oa->setField("body.title","这是被修改后的标题");//支持以点的形式更新(有这个字段就更新，没有就添加)oa内部字段
    app('ding.work-notice')->push($oa);
```

voice
-----

[](#voice)

```
    $voice = new Voice($content['media_id' => 'media_id','duration' => 10]);
    $response = app('ding.work-notice')->push($voice);
    // 判断是否推送成功
    $response->isSuccess():bool;
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Total

3

Last Release

1848d ago

PHP version history (2 changes)1.0.0PHP ^7.1.3

1.0.1PHP ^7.1.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc9705d4dfa84455d0d7ac04775b7fb2ffc2a613de26e5f34cd8685d05edc6fb?d=identicon)[pl1998](/maintainers/pl1998)

---

Top Contributors

[![privarepan](https://avatars.githubusercontent.com/u/26546738?v=4)](https://github.com/privarepan "privarepan (6 commits)")[![pl1998](https://avatars.githubusercontent.com/u/43993206?v=4)](https://github.com/pl1998 "pl1998 (2 commits)")

### Embed Badge

![Health badge](/badges/pl1998-dingtalk/health.svg)

```
[![Health](https://phpackages.com/badges/pl1998-dingtalk/health.svg)](https://phpackages.com/packages/pl1998-dingtalk)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
