{"id":17962939,"url":"https://github.com/hectorqin/think-wechat","last_synced_at":"2025-06-28T16:36:36.117Z","repository":{"id":62515333,"uuid":"219926925","full_name":"hectorqin/think-wechat","owner":"hectorqin","description":"thinkphp5，thinkphp6 wechat sdk","archived":false,"fork":false,"pushed_at":"2019-11-06T06:57:36.000Z","size":7,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T02:33:34.943Z","etag":null,"topics":["sdk","thinkphp","thinkphp5","thinkphp6","wechat"],"latest_commit_sha":null,"homepage":"","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/hectorqin.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":"2019-11-06T06:25:10.000Z","updated_at":"2020-09-22T08:38:59.000Z","dependencies_parsed_at":"2022-11-02T13:03:20.364Z","dependency_job_id":null,"html_url":"https://github.com/hectorqin/think-wechat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hectorqin/think-wechat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorqin%2Fthink-wechat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorqin%2Fthink-wechat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorqin%2Fthink-wechat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorqin%2Fthink-wechat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hectorqin","download_url":"https://codeload.github.com/hectorqin/think-wechat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hectorqin%2Fthink-wechat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262460567,"owners_count":23314765,"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":["sdk","thinkphp","thinkphp5","thinkphp6","wechat"],"created_at":"2024-10-29T11:21:18.097Z","updated_at":"2025-06-28T16:36:36.050Z","avatar_url":"https://github.com/hectorqin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# think-wechat\n\n微信SDK For ThinkPHP 5.1, ThinkPHP 6.0 基于[overtrue/wechat](https://github.com/overtrue/wechat)\n\n## 框架要求\n\nThinkPHP \u003e= 5.1\n\n## 安装\n\n```bash\ncomposer require hectorqin/think-wechat\n```\n\n## 配置\n\n1. 修改配置文件\n修改项目根目录下config/wechat.php中对应的参数\n\n2. 每个模块基本都支持多账号，默认为 default。\n\n## 使用\n\n### 接受普通消息\n\n```php\n\u003c?php\n\nnamespace app\\index\\controller;\n\n\nuse think\\Controller;\n\nclass Wechat extends Controller\n{\n\n    public function index()\n    {\n        //    先初始化微信\n        $app = app('wechat.official_account');\n        $app-\u003eserver-\u003epush(function($message){\n            return 'hello,world';\n        });\n        $app-\u003eserver-\u003eserve()-\u003esend();\n    }\n}\n```\n\n### 获得SDK实例\n\n#### 使用facade\n\n```php\nuse Hectorqin\\ThinkWechat\\Facade;\n\n$officialAccount = Facade::officialAccount();  // 公众号\n$work = Facade::work(); // 企业微信\n$payment = Facade::payment(); // 微信支付\n$openPlatform = Facade::openPlatform(); // 开放平台\n$miniProgram = Facade::miniProgram(); // 小程序\n$openWork = Facade::openWork(); // 企业微信第三方服务商\n$microMerchant = Facade::microMerchant(); // 小微商户\n```\n\n以上均支持传入自定义账号:例如\n\n```php\n$officialAccount = Facade::officialAccount('test'); // 公众号\n```\n\n以上均支持传入自定义账号+配置(注:这里的config和配置文件中账号的格式相同):例如\n\n```php\n$officialAccount = Facade::officialAccount('',$config); // 公众号\n```\n\n更多 SDK 的具体使用请参考：[https://easywechat.com](https://easywechat.com)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorqin%2Fthink-wechat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhectorqin%2Fthink-wechat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorqin%2Fthink-wechat/lists"}