PHPackages                             xiaohuyun/xhysanctum - 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. xiaohuyun/xhysanctum

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

xiaohuyun/xhysanctum
====================

xiaohuyun Sanctum provides a featherweight authentication system for SPAs and simple APIs.

v1.1.2(5y ago)07MITPHPPHP ^7.2

Since Aug 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/feng2009/xhysanctum)[ Packagist](https://packagist.org/packages/xiaohuyun/xhysanctum)[ RSS](/packages/xiaohuyun-xhysanctum/feed)WikiDiscussions master Synced yesterday

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

xiaohuyun xhysanctum

简介
--

[](#简介)

小狐云 xhysanctum 为spa和简单的api提供了一个轻量级的认证系统。基于官方sanctum开发的。

官方文档
----

[](#官方文档)

文档可以在[Laravel website](https://laravel.com/docs/master/sanctum).

行为准则
----

[](#行为准则)

请审阅并遵守 [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

安全漏洞
----

[](#安全漏洞)

请审阅【我们的安全政策】() on how to report security vulnerabilities.

许可证
---

[](#许可证)

小狐云 xhysanctum 是一个开源软件，根据\[MIT许可证\]授权 [MIT license](LICENSE.md).

安装过程
----

[](#安装过程)

composer require xiaohuyun/xhysanctum

接下来，你需要使用 vendor:publish Artisan 命令发布 Sanctum 的配置和迁移文件。Sanctum 的配置文件将会保存在 config 文件夹中

php artisan vendor:publish --provider="Xiaohuyun\\xhysanctum\\SanctumServiceProvider"

最后，你需要执行数据库迁移文件。Sanctum 将创建一个数据库表用于存储 API 令牌：

php artisan migrate

假如你需要使用 Sanctum 来验证 SPA，你需要在 app/Http/Kernel.php 文件中将 Sanctum 的中间件添加到你的 api 中间件组中：

use Xiaohuyun\\xhysanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful;

'api' =&gt; \[ EnsureFrontendRequestsAreStateful::class, 'throttle:60,1', \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class, \],

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

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

Every ~0 days

Total

5

Last Release

2085d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/48717511?v=4)[wuchen](/maintainers/feng2009)[@feng2009](https://github.com/feng2009)

---

Top Contributors

[![feng2009](https://avatars.githubusercontent.com/u/48717511?v=4)](https://github.com/feng2009 "feng2009 (7 commits)")

---

Tags

authxiaohuyunxhysanctum

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xiaohuyun-xhysanctum/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[mpyw/scoped-auth

Apply specific scope for user authentication.

1180.5k](/packages/mpyw-scoped-auth)

PHPackages © 2026

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