PHPackages                             lijinhua/hyperf-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. lijinhua/hyperf-wechat

ActiveLibrary

lijinhua/hyperf-wechat
======================

适用于hyperf的微信sdk

v1.0.0(2y ago)011MITPHPPHP &gt;=8.0

Since Nov 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lijinhua1993/package-hyperf-wechat)[ Packagist](https://packagist.org/packages/lijinhua/hyperf-wechat)[ RSS](/packages/lijinhua-hyperf-wechat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (2)Used By (0)

hyperf-wechat
=============

[](#hyperf-wechat)

微信 SDK for Hyperf， 基于 w7corp/easywechat

由于 easywechat v6 使用了 symfony/http-client作为请求库，hyperf提供了ClassMap替换能力，此包替换EasyWechat底层InteractWithHttpClient中的HttpClient对象实例，支持协程。

安装
--

[](#安装)

```
composer require lijinhua/hyperf-wechat
```

配置
--

[](#配置)

1. 发布配置文件

```
php ./bin/hyperf.php vendor:publish lijinhua/hyperf-wechat
```

2. 修改根目录下的 `config/autoload/wechat.php` 中对应的参数即可。
3. 每个模块都支持多账号，默认为 `default`。

使用
--

[](#使用)

接收普通消息例子：

```
Router::addRoute(['GET', 'POST', 'HEAD'], '/wechat', 'App\Controller\WeChatController@serve');
```

> 注意：微信服务端认证的时候是 `GET`, 接收用户消息时是 `POST` ：

```
