PHPackages                             mistcheng/sowechat - 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. [Framework](/categories/framework)
4. /
5. mistcheng/sowechat

ActiveProject[Framework](/categories/framework)

mistcheng/sowechat
==================

基于Laravel PHP框架的微信网页版Api架构 &amp; Wechat(WeiXin) Web Api Based On Laravel PHP Framework

v1.1(9y ago)1494MITPHPPHP &gt;=5.6.4

Since Oct 5Pushed 9y ago2 watchersCompare

[ Source](https://github.com/mistcheng/sowechat)[ Packagist](https://packagist.org/packages/mistcheng/sowechat)[ RSS](/packages/mistcheng-sowechat/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (9)Versions (3)Used By (0)

Wechat(WeiXin) Web Api Based On Laravel PHP Framework
=====================================================

[](#wechatweixin-web-api-based-on-laravel-php-framework)

[中文文档：基于Laravel PHP框架的微信网页版Api](https://github.com/mistcheng/sowechat/blob/master/readme_zh.md)

[![Build Status](https://camo.githubusercontent.com/8d7899ed902ef9a5d7e3a1f02af6a7aa1081b33b15c8d9c1561bea6e302f673c/68747470733a2f2f7472617669732d63692e6f72672f6d6973746368656e672f736f7765636861742e737667)](https://travis-ci.org/mistcheng/sowechat)[![Total Downloads](https://camo.githubusercontent.com/2615efe7a41fbe87f94a97fa7579115350ae9cd2500f20aaa16e256efe238991/68747470733a2f2f706f7365722e707567782e6f72672f6d6973746368656e672f736f7765636861742f642f746f74616c2e737667)](https://packagist.org/packages/mistcheng/sowechat)[![Latest Stable Version](https://camo.githubusercontent.com/38992c6cf455579b8683aaf8883e56888f777991acff90715da5b5f7455e0a48/68747470733a2f2f706f7365722e707567782e6f72672f6d6973746368656e672f736f7765636861742f762f737461626c652e737667)](https://packagist.org/packages/mistcheng/sowechat)[![Latest Unstable Version](https://camo.githubusercontent.com/f9ef9b3d1afcca933b067c951d2e9d06be5ff50a1b009a1272b283a31f1943b3/68747470733a2f2f706f7365722e707567782e6f72672f6d6973746368656e672f736f7765636861742f762f756e737461626c652e737667)](https://packagist.org/packages/mistcheng/sowechat)[![License](https://camo.githubusercontent.com/b580658194e6afbf80254a6dad6f90cd7a3aaae056183c1e8071d1f58bd75099/68747470733a2f2f706f7365722e707567782e6f72672f6d6973746368656e672f736f7765636861742f6c6963656e73652e737667)](https://packagist.org/packages/mistcheng/sowechat)

Features
--------

[](#features)

> 1. `7*24`hours no-end running,
> 2. easy to use, support sending/receiving multi type messages
> 3. graceful system architecture, support `cross platform` development and flexible custom `extensions`
> 4. support `Restful Api`, `async message processing` and`message event broadcasting`
> 5. based on `Php`, the best language in The World! :)

System Architecture
-------------------

[](#system-architecture)

[![System Architecture](https://camo.githubusercontent.com/fa4a9385c147a0d50b4941173d2b7820bc23491c8b1ed78db805b9c7be85f299/687474703a2f2f6f756b65692e6d652f696d616765732f736f7765636861745f617263685f76312e312e737667)](https://camo.githubusercontent.com/fa4a9385c147a0d50b4941173d2b7820bc23491c8b1ed78db805b9c7be85f299/687474703a2f2f6f756b65692e6d652f696d616765732f736f7765636861745f617263685f76312e312e737667)

> 1. This System is composed of 3 independent components
> 2. The `Middle` component is core of The System, doing qrcode scan &amp; message listening; I do a lot of work for pupose of robust. Meantime, as a connector, it supports message-sending ability for the `Left` component, and pushs simple-formated message to the `Right` component. Run command `php artisan wechat:listen` to make it working.
> 3. The`Left`component is used for sending message, the user can send message to any friends in his code. class `App\Console\Commands\WechatSend` is a sample, run command`php artisan wechat:send` to make it working.
> 4. The`Right`component is used for processing message, the user can do anything for the coming message. The job`App\Jobs\ProcessWechatMessage` process each message into more formatted message(text,share,image,voice,file, etc). Next, It fires the `App\Events\WechatMessageEvent` event to the subscribers, who can do some custom things with the message. class `App\Listeners\SaveWechatMessageListener` is a sample that saving the message into the DB.
> 5. `Advantage`: The three components are 3 independent Process. this can grantee the non-ending running of the `Middle` part, at the same time, the user can do any extensions in the `Left` and `Right` part without disturbing the `Middle` part.

Prerequisite
------------

[](#prerequisite)

> 1. php 5.6 or more
> 2. php composer
> 3. redis (optional)
> 4. mysql (optional)

Usage
-----

[](#usage)

### 1. Installation

[](#1-installation)

```
git clone https://github.com/mistcheng/sowechat.git
cd sowechat
composer install
```

### 2. Configration

[](#2-configration)

#### 2.1 `config/wechat.php` is wechat config file

[](#21-configwechatphp-is-wechat-config-file)

```
