uilewis / laravel-wx-xcx
腾讯小程序
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/uilewis/laravel-wx-xcx
Requires
- php: >=5.5.0
This package is auto-updated.
Last update: 2025-12-28 19:44:03 UTC
README
laravel-wx-xcx
腾讯微信小程序composer包
***************************
laravel Installation
Install via composer
Run the following command to pull in the latest version:
composer命令安装扩展包
composer require uilewis/laravel-wx-xcx
For laravel >=5.5 that's all. This package supports Laravel new Package Discovery.
If you are using Laravel < 5.5, you also need to add YueCode\Cos\QCloudCosServiceProvider::class to your config/app.php providers array:
如果laravel版本小于5.5 需要添加YueCode\Cos\QCloudCosServiceProvider::class到 config/app.php 文件中如下:
'providers' => [ /* * Application Service Providers... */ ...... Uilewis\WxXcx\WxXcxServiceProvider::class, ],
To publish the config settings in Laravel 5 use:
执行命令复制COS配置文件到config目录
php artisan vendor:publish --provider=" Uilewis\WxXcx\WxXcxServiceProvider"
Configure config
配置config/cos.php
config/xcx_wx.php
Usage
使用
...... // 微信小程序 $xcx = app('xcx'); /** * 通过code获取用户信息 * @param $code 小程序code * @return array 用户信息 */ $user_info_arr = $xcx->getLoginInfo($code);
***************************
Lumen Installation
Install via composer
Run the following command to pull in the latest version:
composer require uilewis/laravel-wx-xcx
Bootstrap file changes. Add the following snippet to the bootstrap/app.php file under the providers section as follows:
添加以下代码到bootstrap/app 文件中 Register Service Providers 部分
$app->register(UiLewis\WxXcx\WxXcxServiceProvider::class);
Configure config
配置config/cos.php
config/xcx_wx.php