hanson/wechat

The Lumen Framework for wechat.

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 12

Watchers: 1

Forks: 1

Type:project

dev-master 2020-02-13 10:41 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:07:01 UTC


README

A wechat Application build on lumen

此项目已废弃,请移步:https://github.com/Hanson/laravel-admin-wechat

此项目基于lumen以及easywechat开发的微信项目

*注意:如使用laravel,可使用 wechat-handler

Installation

composer create-project hanson/wechat wechat dev-master

Configure

配置env,填写好需要的wechat信息即可

cp .env.example .env

Migration

暂时提供两个表,wechat_user以及message,执行migrate即可生成数据表

php artisan migrate

Handler

所有消息事件都位于app/Handlers中,事件Handler位于app/Handlers/EventHandlers

Service

所有的服务事件,直接在继承BaseController 的 Controller中 调用 $this->service即可

#example:
class MyController extends BaseController{

    public function index(){
        $user = $this->user;
        echo $user->get('openid')->nickname;
    }
}