PHPackages                             abe/cache-for-laravel-sanctum - 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. [Caching](/categories/caching)
4. /
5. abe/cache-for-laravel-sanctum

AbandonedArchivedLibrary[Caching](/categories/caching)

abe/cache-for-laravel-sanctum
=============================

Let Laravel Sanctum use cache to retrieve token

v0.6.0(1y ago)1710.4k↓27.8%7MITPHPPHP ^8.0CI passing

Since Aug 13Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/abrahamgreyson/cache-for-laravel-sanctum)[ Packagist](https://packagist.org/packages/abe/cache-for-laravel-sanctum)[ Docs](https://github.com/abrahamgreyson/cache-for-laravel-sanctum)[ RSS](/packages/abe-cache-for-laravel-sanctum/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (13)Versions (9)Used By (0)

Let Laravel Sanctum Use Cache to Retrieve Tokens
================================================

[](#let-laravel-sanctum-use-cache-to-retrieve-tokens)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4fe1cc27f17b252818dc90f80df258db92549e8f3ebeea69e674404934c9a1d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6162652f63616368652d666f722d6c61726176656c2d73616e6374756d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abe/cache-for-laravel-sanctum)[![run-tests](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/run-tests.yml/badge.svg)](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/run-tests.yml)[![Check & fix styling](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/php-cs-fixer.yml/badge.svg?branch=main)](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/php-cs-fixer.yml)[![Total Downloads](https://camo.githubusercontent.com/b67742383fad9da6310881586b2a5736b58b4a2c9e891003fefe5f1227cafc9b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6162652f63616368652d666f722d6c61726176656c2d73616e6374756d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abe/cache-for-laravel-sanctum)

Laravel Sanctum executes 3 database queries for every HTTP request. This package wraps the default `PersonalAccessToken` model, uses cache to retrieve the `personal_access_token` and `tokenable` model. This reduces 2 queries for most requests.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require abe/cache-for-laravel-sanctum
```

Usage
-----

[](#usage)

Once you have this package in your project, Sanctum tokens will be retrieved through cache automatically. Redis cache is recommended.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [abraham greyson](https://github.com/abrahamgreyson)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance52

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.5% 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 ~134 days

Recently: every ~180 days

Total

8

Last Release

433d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1341308?v=4)[刘阳](/maintainers/abrahamgreyson)[@abrahamgreyson](https://github.com/abrahamgreyson)

---

Top Contributors

[![abrahamgreyson](https://avatars.githubusercontent.com/u/1341308?v=4)](https://github.com/abrahamgreyson "abrahamgreyson (38 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![masrodjie](https://avatars.githubusercontent.com/u/2186593?v=4)](https://github.com/masrodjie "masrodjie (1 commits)")[![Derbaaa](https://avatars.githubusercontent.com/u/75489459?v=4)](https://github.com/Derbaaa "Derbaaa (1 commits)")[![angeliquevd](https://avatars.githubusercontent.com/u/3462620?v=4)](https://github.com/angeliquevd "angeliquevd (1 commits)")[![great-jos](https://avatars.githubusercontent.com/u/26372834?v=4)](https://github.com/great-jos "great-jos (1 commits)")

---

Tags

cachelaravellaravel-frameworksanctumlaraveltokencachesanctumabecache-for-laravel-sanctum

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/abe-cache-for-laravel-sanctum/health.svg)

```
[![Health](https://phpackages.com/badges/abe-cache-for-laravel-sanctum/health.svg)](https://phpackages.com/packages/abe-cache-for-laravel-sanctum)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[omaralalwi/lexi-translate

Laravel translation package with morph relationships and caching.

754.3k2](/packages/omaralalwi-lexi-translate)[michele-angioni/support

Support is a Laravel package which promotes the use of best practices and design patterns.

181.4k1](/packages/michele-angioni-support)[makbulut/laravel-aerospike

Aerospike cache driver for Laravel

102.2k](/packages/makbulut-laravel-aerospike)

PHPackages © 2026

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