PHPackages                             lion9966/think-utils - 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. lion9966/think-utils

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

lion9966/think-utils
====================

thinkphp 6 常用工具集合

V2.2.3(3y ago)04MITPHPPHP &gt;=7.2

Since Jun 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lion9966/think-utils)[ Packagist](https://packagist.org/packages/lion9966/think-utils)[ RSS](/packages/lion9966-think-utils/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (8)Used By (0)

think-utils
===========

[](#think-utils)

thinkphp 6 常用工具集合

将thinkphp常用的：

- 错误提示（think-exception），
- 权限管理（think-permission），
- JWT，
- 集成腾讯短信验证，邮件验证码发送，
- 密码
- 随机数
- 树

### 安装

[](#安装)

```
composer require lion9966/think-utils

```

### 使用方法

[](#使用方法)

```
use lion9966\utils

```

- 错误提示（think-exception）：

```
use lion9966\utils\exception\ResPonseCode;
use lion9966\utils\exception\ResPonseJson;

//通过server自动绑定think\exception\Handle，如果没绑定执行如下
//需要在app/provide.php内定义：
//'think\exception\Handle'=>\lion9966\utils\exception\ExceptionHandle::class
//进行自定义错误处理

//use lion9966\utils\exception\ExceptionHandle;
```

- 权限管理（think-permission）： 安装后，配置连接好数据库后，执行命令：

```
php think permission:install

```

进行数据库安装

使用方法，具体见: lion9966\\think-permission

```
//引用
use lion9966\utils\permission;
//权限验证中间件
use lion9966\utils\middleware;
permission::class;
```

- JWT： 自动集成lcobucci/jwt 4.3.0，已设置好Token,中间件直接使用即可

```
//jwt权限验证中间件
use lion9966\utils\middleware;
Auth::class;

//引用Token方法
use lion9966\utils\Token;
```

- 集成腾讯短信验证，邮件验证码发送： 自动集成腾讯qcloudsms/qcloudsms\_php短信发送，可在此基础SmsCode改发送其他短信； 自动集成邮件swiftmailer/swiftmailer发送，可以在此基础上SendCodeMail改发送其他邮件； 默认只发送验证码
- 密码： 密码产生和验证方法Password

```
//引用方法
use lion9966\utils\Password;
```

- 随机数： uuid和随机字符串产生方法Random

```
//引用方法
use lion9966\utils\Random;
```

- 树：

```
//引用方法
use lion9966\utils\Tree;
```

另外：验证/登录后用户数据

```
//引用方法
use lion9966\utils\data\UserData;
//已在jwt验证后，绑定类
bind('user-data', UserData::class);
//信息初始化
app('user-data')->withId($userId)->withData($user);
```

配置，具体见：

```
//权限验证过滤
auth;
//权限管理数据库配置
permission
//工具集合综合配置（涉及到敏感信息，必须修改）
utils
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Every ~1 days

Total

7

Last Release

1096d ago

PHP version history (2 changes)V2.0.0PHP &gt;=7.4

V2.1.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/82ed1f9fda64af34257299c2eaa36264ed4605d61ea5becdd77e8e9f1c66b371?d=identicon)[lion9966](/maintainers/lion9966)

---

Top Contributors

[![lion9966](https://avatars.githubusercontent.com/u/67695096?v=4)](https://github.com/lion9966 "lion9966 (9 commits)")

### Embed Badge

![Health badge](/badges/lion9966-think-utils/health.svg)

```
[![Health](https://phpackages.com/badges/lion9966-think-utils/health.svg)](https://phpackages.com/packages/lion9966-think-utils)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[zoujingli/think-library

Core library and common services for ThinkAdmin

8373.4k20](/packages/zoujingli-think-library)[shopware/app-php-sdk

Shopware App SDK for PHP

15109.8k3](/packages/shopware-app-php-sdk)[pimcore/studio-backend-bundle

Pimcore Studio Backend Bundle

20203.9k22](/packages/pimcore-studio-backend-bundle)[ichynul/tpextmyadmin

thinkphp extension

141.6k](/packages/ichynul-tpextmyadmin)

PHPackages © 2026

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