PHPackages                             decent/wechat - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. decent/wechat

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

decent/wechat
=============

WeChat Auth

v1.5.0(9y ago)2481MITPHPPHP &gt;= 5.5.30

Since Mar 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Decent-Dexter/QYH-Auth)[ Packagist](https://packagist.org/packages/decent/wechat)[ RSS](/packages/decent-wechat/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

微信企业号授权登录
=========

[](#微信企业号授权登录)

安装
--

[](#安装)

1. 使用composer下载扩展包
    `composer require decent/wechat`
2. 在项目 config/app.php 文件中的providers数组中，添加以下代码引入服务提供器
    `Decent\Wechat\WechatServiceProvider::class`
3. 运行以下命令，将配置文件发布到config文件夹
    `php artisan vendor:publish`

配置
--

[](#配置)

##### 企业号id - `corp_id`

[](#企业号id---corp_id)

##### 企业号secret - `corp_secret`

[](#企业号secret---corp_secret)

##### 认证回调地址 - `auth_action`

[](#认证回调地址---auth_action)

一个URL地址。
用户使用微信企业号登录，扫码后会重定向到这个URL，附带用户认证的code。
可在这个URL中添加认证的业务逻辑

##### 实现提供器 - `providers`

[](#实现提供器---providers)

认证流程需要用到以下几个实现，其中session和微信认证已有默认提供器：

1. 查找用户
    需要提供根据企业号成员ID获取用户model的函数
2. 保存Session 用户登录时保存session，登出时销毁session
3. 微信认证
    认证登录页重定向回来的code，获取企业号用户ID

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~18 days

Total

4

Last Release

3325d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17230c7079815285a33dedf1a5534b53722a0a7837fca82681d7b1e3808de3b0?d=identicon)[Decent-Dexter](/maintainers/Decent-Dexter)

---

Top Contributors

[![ba6yface](https://avatars.githubusercontent.com/u/12292869?v=4)](https://github.com/ba6yface "ba6yface (6 commits)")

---

Tags

dexter

### Embed Badge

![Health badge](/badges/decent-wechat/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10920.2k](/packages/rahul900day-laravel-captcha)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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