Looking to hire Laravel developers? Try LaraJobs

cache-laravel-sanctum maintained by ringzhu

Description
Sanctum use cache to retrieve token
Author
Last update
2025/03/13 07:20 (dev-main)
License
Links
Downloads
75

Comments
comments powered by Disqus

cache-laravel-sanctum

Let Laravel Sanctum Use Cache to Retrieve Tokens

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

You can install the package via composer:

composer require ringzhu/cache-laravel-sanctum

Usage

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