PHPackages                             zodream/wechat - 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. [API Development](/categories/api)
4. /
5. zodream/wechat

ActiveLibrary[API Development](/categories/api)

zodream/wechat
==============

wechat api client

5.0(4y ago)0951MITPHPPHP &gt;=8.0

Since Jan 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/zodream/wechat)[ Packagist](https://packagist.org/packages/zodream/wechat)[ Docs](https://github.com/zodream/wechat)[ RSS](/packages/zodream-wechat/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (3)Versions (10)Used By (0)

wechat
======

[](#wechat)

微信公众号开发

- [微信公众号](#wechat)
    - [配置](#wechat-config)
    - [消息被动接收回复](#wechat-message)
    - [自定义菜单](#wechat-menu)
- [微信公众号第三方平台](#platform)
    - [事件推送](#platform-notify)
    - [管理](#platform-manage)
    - [授权登录](#platform-oauth)

微信公众号
-----

[](#微信公众号)

### 配置

[](#配置)

```
'wechat' => [
    'appid' => '',
    'token' => '',
    'aes_key' => '',
    'secret' => '',
    'redirect_uri' => '',
    'platform' => [  // 第三方平台配置
        'component_appid' => '',
        'aes_key' => '',
        'token' => '',
        'component_appSecret' => ''
    ]
]
```

### 消自定义菜单

[](#消自定义菜单)

获取菜单

```
(new Menu())->menuList();
```

设置菜单

```
(new Menu())->create(
    MenuItem::menu(MenuItem::name('网址')->setUrl('http://zodream.cn'))
        ->setMenu(
            MenuItem::menu(MenuItem::name('点击')->setKey(1))
            ->setMenu(MenuItem::name('点击')->setKey(1))
        )
        ->setMenu(MenuItem::name('查看')->setMediaId('132123123'))
);
```

删除全部菜单

```
(new Menu())->deleteMenu();
```

### 消息被动接收回复

[](#消息被动接收回复)

```
$message = new Message();
return $message->on([EventEnum::ScanSubscribe, EventEnum::Subscribe],
    function(Message $message, MessageResponse $response) {
    $response->setText('谢谢关注！');
})->on(EventEnum::Message, function(Message $message, MessageResponse $response) {
    $response->setText(sprintf('您的消息是: %s', $message->content));
})->on(EventEnum::UnSubscribe, function(Message $message, MessageResponse $response) {
    $response->setText('取消关注');
})->on(EventEnum::Click, function(Message $message, MessageResponse $response) {
    $response->setText(sprintf('您点击了 %s', $message->eventKey));
})->run();
```

最后返回 MessageResponse $response;

微信公众号第三方平台
----------

[](#微信公众号第三方平台)

### 事件推送

[](#事件推送)

```
```

### 管理

[](#管理)

### 授权登录

[](#授权登录)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance61

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~211 days

Recently: every ~272 days

Total

8

Last Release

1618d ago

Major Versions

v1.0 → v2.02018-01-25

2.4 → 4.02020-10-02

4.0 → 5.02022-01-24

PHP version history (3 changes)v1.0PHP &gt;=5.6.0

4.0PHP &gt;=7.0.0

5.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

[![zx648383079](https://avatars.githubusercontent.com/u/9996852?v=4)](https://github.com/zx648383079 "zx648383079 (51 commits)")

---

Tags

wechatzodreamwechat api client

### Embed Badge

![Health badge](/badges/zodream-wechat/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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