hypervel / sanctum
The Hypervel Sanctum package.
v0.3.28
2026-01-05 05:55 UTC
Requires
- php: ^8.2
- hyperf/database: ~3.1.0
- hyperf/http-server: ~3.1.0
- hypervel/auth: ^0.3
- hypervel/console: ^0.3
- hypervel/support: ^0.3
- nesbot/carbon: ^2.72.6
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 0.4.x-dev
- 0.3.x-dev
- dev-main / 0.3.x-dev
- v0.3.28
- v0.3.27
- v0.3.26
- v0.3.25
- v0.3.24
- v0.3.23
- v0.3.22
- v0.3.21
- v0.3.20
- v0.3.19
- v0.3.18
- v0.3.17
- v0.3.16
- v0.3.15
- v0.3.14
- v0.3.13
- v0.3.12
- v0.3.11
- v0.3.10
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- 0.2.x-dev
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
This package is auto-updated.
Last update: 2026-11-02 12:42:33 UTC
README
Documentation: https://hypervel.org/docs/sanctum
Differences From Laravel
- Hypervel only supports the
id|tokenformat returned bycreateToken(). Laravel's legacy plain-token lookup is omitted because Hypervel's token cache and invalidation paths are keyed by token ID. - Hypervel includes optional token and tokenable lookup caching for Swoole workers. Missing token IDs are cached as
nullfor the configured TTL. Missing tokenable models are not cached because their visibility may depend on the current query context. - When caching is enabled, the selected personal-access-token model, configured Sanctum guard provider models, and stock Eloquent graph containers are added to the cache class policy automatically. Applications declare custom-provider morph targets, nested relations, custom containers, and other application-owned objects with
Cache::allowSerializableClassesUsing()during provider boot. - Sanctum validates its cache store during process startup. Redis, database, file, and Swoole stores with atomic locks are accepted; storage, stack, array, worker-array, null, session, failover, and type-destroying Redis serializer modes are rejected. Accepted native Redis serializers preserve model types but bypass the PHP class policy.
- Cached token entries never embed
tokenable. Positive tokenable entries are shared by morph identity. Token mutations invalidate token entries, while tokenable model saves and deletes invalidate the shared owner entry. Invalidations wait for the owning database transaction to commit. HasApiTokens::tokens()uses the protectednewTokenRelation()factory instead of the model-widenewMorphMany()hook.- Hypervel ships an explicit default
sanctumguard. Laravel's globalsanctum.guardaccept-list is omitted; each Sanctum guard declares trusted session guards withauth.guards.{guard}.session_guards. An empty list means bearer tokens only, a missing key is a configuration error, and stateful users must match the Sanctum guard's provider instead of accepting any listed guard's user unchecked. - Sanctum middleware priority is enabled by calling
Middleware::statefulApi()inbootstrap/app.php; the package provider does not mutate global middleware priority. sanctum.statefulis renamedsanctum.stateful_domains, matching theSANCTUM_STATEFUL_DOMAINSenvironment variable and the key's actual contents.- Sanctum's session password-hash artifacts are HMAC-only. Laravel's raw-hash fallback for legacy sessions is intentionally omitted because Hypervel 0.4 has no released legacy sessions.
Ported from: https://github.com/laravel/sanctum