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 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2181d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M315](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1614.1k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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