{"id":17246231,"url":"https://github.com/hanson/wechat-handler","last_synced_at":"2025-04-14T04:35:47.291Z","repository":{"id":62514489,"uuid":"64935040","full_name":"Hanson/wechat-handler","owner":"Hanson","description":"A package to create some base handler for wechat events faster!","archived":false,"fork":false,"pushed_at":"2016-08-28T06:53:01.000Z","size":13,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-14T21:28:16.048Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hanson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-04T13:01:32.000Z","updated_at":"2024-03-14T21:28:16.049Z","dependencies_parsed_at":"2022-11-02T13:30:37.558Z","dependency_job_id":null,"html_url":"https://github.com/Hanson/wechat-handler","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanson%2Fwechat-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanson%2Fwechat-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanson%2Fwechat-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanson%2Fwechat-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hanson","download_url":"https://codeload.github.com/Hanson/wechat-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240154079,"owners_count":19756387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:32:48.698Z","updated_at":"2025-02-24T17:31:15.422Z","avatar_url":"https://github.com/Hanson.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wechat-handler\nA package to create some base handler for wechat events faster!\n帮你更快地生成微信事件文件\n\n## 依赖\n\nlaravel 5+ (lumen 请看 [wechat](https://github.com/HanSon/wechat))\n\nEasyWechat 3+\n\n## 安装\n\n```\ncomposer require hanson/wechat-handler\n```\n\n## 使用\n\n在`config/app.php`的provider尾部加上\n\n```\n\n    App\\Providers\\EventServiceProvider::class,\n    \n    App\\Providers\\RouteServiceProvider::class,\n    # 加上\n    Hanson\\Wechat\\Handler\\WechatHandlerServiceProvider::class,\n```\n\n然后执行```php artisan make:handler```\n\n接下来会生成若干文件\n\n`app\\Handler`目录，负责处理所有的微信事件\n\n`app\\Http\\Controllers\\Wechat`为微信的controller\n\n`config\\wechat.php` 微信的配置（自行选择是否使用）\n\n## 文档\n\n### Handler\n所有消息事件都位于`app/Handlers`中，事件Handler位于`app/Handlers/EventHandlers`中\n\n\n### Service\n所有的服务事件，直接在继承BaseController 的 Controller中 调用 $this-\u003eservice即可\n\n    #example:\n    class MyController extends BaseController{\n    \n        public function index(){\n            $user = $this-\u003euser;\n            echo $user-\u003eget('openid')-\u003enickname;\n        }\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanson%2Fwechat-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanson%2Fwechat-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanson%2Fwechat-handler/lists"}