PHPackages                             yfl/thinkphp5-auth - 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. yfl/thinkphp5-auth

ActiveLibrary

yfl/thinkphp5-auth
==================

a auth of Thinkphp5

1.0.1(6y ago)1241MITPHPPHP &gt;=7.0

Since Aug 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/554665488/thinkphp5-auth)[ Packagist](https://packagist.org/packages/yfl/thinkphp5-auth)[ RSS](/packages/yfl-thinkphp5-auth/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

think-addons
============

[](#think-addons)

The ThinkPHP5.1 Auth Package 基于thinkphp5.1 简单的auth验证 #Email

安装
--

[](#安装)

> composer require yfl/thinkphp5-auth:1.0.1

```
#可以自定义的配置 /config/auth.php
return [
    'table'  => [
        // 和Database/migrations 定义的迁移文件一致
        'group'        => 'group', //权限组
        'auth_group_access' => 'auth_group_access', //权限组和用户关联中间表
        'auth'         => 'auth', //权限规则表
        'user'         => 'user', //用户表
        'role'         => 'role', //系统用户角色表
        'group_auth'        => 'group_auth', //权限组和权限规则关联表
        'user_role_access'       => 'user_role_access', //权限组和角色关联表
    ],
    'switch'=>[
        'auth_on'           => 1, // 权限开关
        'auth_type'         => 1, // 认证方式，1为实时认证；2为登录认证。
    ],
    基于layui把composer下载包里边的layui文件放到public目录下 改成为你的目录
    'path' => [
        'layui_css' => '/static/js/plugins/layui/css/layui.css',
        'layui_js' => '/static/js/plugins/layui/layui.js',
        'jquery' => '/static/js/jquery.min.js',
        'extend_config' => '/static/js/plugins/layui/config.js',
        'formSelectsCss' => '/static/js/plugins/layui/extend/fromSelect/formSelects-v4.css',
    ],
    //数据列表配置
    'table_config' => [
        'limit' => 30 //获取列表数据的数量
    ]
];
路由地址
Route::group('auth', [
    //user
    'user_list' => ['thinkAuth\Controller\Users@userList', ['method' => 'get']],
    'ajax_get_user_list' => ['thinkAuth\Controller\Users@ajaxGetUserList', ['method' => 'get,post']],
    'ajax_add_user' => ['thinkAuth\Controller\Users@ajaxAddUser', ['method' => 'get.post']],
    'ajax_del_user' => ['thinkAuth\Controller\Users@ajaxDelUser', ['method' => 'post']],
    'ajax_edit_user' => ['thinkAuth\Controller\Users@ajaxEditUser', ['method' => 'get,post']],
    //auth
    'auth_list' => ['thinkAuth\Controller\Auth@authList', ['method' => 'get']],
    'ajax_get_auth_list' => ['thinkAuth\Controller\Auth@ajaxGetAuthList', ['method' => 'get']],
    'ajax_add_auth' => ['thinkAuth\Controller\Auth@ajaxAddAuth', ['method' => 'get,post']],
    'ajax_edit_auth' => ['thinkAuth\Controller\Auth@ajaxEditAuth', ['method' => 'get,post']],
    'ajax_del_auth' => ['thinkAuth\Controller\Auth@ajaxDelAuth', ['method' => 'post']],
    'get_auth_all/' => ['thinkAuth\Controller\Auth@getAuthAll', ['method' => 'get']],//获取所有的权限列表
    //group
    'group_list' => ['thinkAuth\Controller\Group@groupList', ['method' => 'get']],
    'ajax_get_group_list' => ['thinkAuth\Controller\Group@ajaxGetGroupList', ['method' => 'get']],
    'ajax_add_group' => ['thinkAuth\Controller\Group@ajaxAddGroup', ['method' => 'get,post']],
    'ajax_edit_group' => ['thinkAuth\Controller\Group@ajaxEditGroup', ['method' => 'get,post']],
    'ajax_del_group' => ['thinkAuth\Controller\Group@ajaxDelGroup', ['method' => 'post']],
    'allocation_auth' => ['thinkAuth\Controller\Group@allocationAuth', ['method' => 'get,post']],
]);
demo地址
http://yadmin.nizouba.cn/admin

$auth = Auth::getInstance();
检查权限用户
$auth->checkAuths(1, true);         用户ID ,是否缓存权限

获取用户已有的权限
$auth->getUserAuths(1,true);    用户ID ,是否缓存权限

获取用户属于的组和角色
$auth->getGroupsAndRolesAndAuthsByUid(1,true);    用户ID ,是否缓存权限

删除权限缓存
$auth->rmAuthCache($uid)

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

2461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8699cefa0e28b7999cc3a15d2cc38733b6ca2473163e609943fd6ef0e99a11bd?d=identicon)[554665488](/maintainers/554665488)

---

Top Contributors

[![554665488](https://avatars.githubusercontent.com/u/20768165?v=4)](https://github.com/554665488 "554665488 (36 commits)")

### Embed Badge

![Health badge](/badges/yfl-thinkphp5-auth/health.svg)

```
[![Health](https://phpackages.com/badges/yfl-thinkphp5-auth/health.svg)](https://phpackages.com/packages/yfl-thinkphp5-auth)
```

PHPackages © 2026

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