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)1811.3k↑39.7%7MITPHPPHP ^8.0CI passing

Since Aug 13Pushed 11mo 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 1w 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

39

—

LowBetter than 84% of packages

Maintenance46

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

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

525d 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.8k9.3M74](/packages/spatie-laravel-responsecache)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6796.8k7](/packages/hasinhayder-tyro)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[omaralalwi/lexi-translate

Laravel translation package with morph relationships and caching.

7318.8k8](/packages/omaralalwi-lexi-translate)

PHPackages © 2026

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