PHPackages                             vicleos/wxxcx - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vicleos/wxxcx

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vicleos/wxxcx
=============

A WeChat applet (xiaochengxu) plugins for Laravel 5.

v1.0(9y ago)13955MITPHPPHP &gt;=5.5.9

Since May 10Pushed 9y ago3 watchersCompare

[ Source](https://github.com/vicleos/wxxcx)[ Packagist](https://packagist.org/packages/vicleos/wxxcx)[ RSS](/packages/vicleos-wxxcx/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

\[laravel-wxxcx\] package
=========================

[](#laravel-wxxcx-package)

Laravel 5 微信小程序插件

备注
--

[](#备注)

Api说明对应方法[wx.login](https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-login.html)登录$obj-&gt;getLoginInfo[wx.getUserInfo](https://mp.weixin.qq.com/debug/wxadoc/dev/api/open.html#wxgetuserinfoobject)获取用户信息$obj-&gt;getUserInfo($encryptedData,$iv);reference：安装
--

[](#安装)

执行以下命令安装最新稳定版本:

```
composer require vicleos/wxxcx
```

或者添加如下信息到你的 `composer.json` 文件中 :

```
"vicleos/wxxcx": "1.*"
```

然后注册服务提供者到 Laravel中 具体位置：`/config/app.php` 中的 `providers` 数组:

```
Vicleos\Wxxcx\WxxcxServiceProvider::class,
```

发布所需的资源(样式、视图、配置文件等):

```
php artisan vendor:publish --provider="Vicleos\Wxxcx\WxxcxServiceProvider"
```

命令完成后，会添加一个`wxxcx.php`配置文件到您的配置文件夹 如 : `/config/wxxcx.php`。

生成配置文件后，将小程序的 `AppID` 和 `AppSecret` 填写到 `/config/wxxcx.php` 文件中

在Laravel 5控制器中使用 (示例)
---------------------

[](#在laravel-5控制器中使用-示例)

```
...
use Vicleos\Wxxcx\Wxxcx;
...
class YourController extends Controller
{
    ...

    private function getWxxcx()
    {
        return new Wxxcx(config('wxxcx'));
    }

    /* 根据 code , encryptedData , iv 获取用户解密后的信息 */
    public function getWxUserInfo(Request $rq)
    {
        //使用 ajax 请求将获取的加密数据和参数发送到这里

        //code 在小程序端使用 wx.login 获取
        $code = $rq->input('code');
        //encryptedData 和 iv 在小程序端使用 wx.getUserInfo 获取
        $encryptedData = $rq->input('encryptedData');
        $iv = $rq->input('iv');

        //小程序类实例化
        $wxxcx = $this->getWxxcx();
        //根据 code 获取用户 session_key 等信息
        $wxxcx->getLoginInfo($code);
        //获取解密后的用户信息
        return $wxxcx->getUserInfo($encryptedData, $iv);
    }

    ...
}
```

reponse:

```
{
    "openId": "xxxx",
    "nickName": "Vicleos",
    "gender": 1,
    "language": "zh_CN",
    "city": "Beijing",
    "province": "Beijing",
    "country": "CN",
    "avatarUrl": "http://wx.qlogo.cn/mmopen/vi_32/xxxx",
    "unionId": "xxxxx",
    "watermark": {
        "timestamp": 1465251521,
        "appid": "your appid"
    }
}

```

小程序端如何获取 `wx.login()` 中的 `code`
-------------------------------

[](#小程序端如何获取-wxlogin-中的-code)

```
...
    wx.login({
        success: function (res) {
            console.log(res.code);
            //结果 "071A8Miq00onPq1BpUgq0NBPiq0xxxx"
        }
    })
...
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3291d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46961aecae8ab5a4a284a213238aef0d77849100f5b701f38b89eec8d58ca0ff?d=identicon)[vicleos](/maintainers/vicleos)

---

Top Contributors

[![vicleos](https://avatars.githubusercontent.com/u/28558609?v=4)](https://github.com/vicleos "vicleos (13 commits)")

---

Tags

laravelwechatxcxwxxcx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vicleos-wxxcx/health.svg)

```
[![Health](https://phpackages.com/badges/vicleos-wxxcx/health.svg)](https://phpackages.com/packages/vicleos-wxxcx)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
