abe/cache-for-laravel-sanctum

Let Laravel Sanctum use cache to retrieve token

v0.5.0 2023-12-24 19:59 UTC

This package is auto-updated.

Last update: 2024-12-08 01:26:41 UTC


README

Latest Version on Packagist run-tests Check & fix styling Total Downloads

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 abe/cache-for-laravel-sanctum

Usage

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

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.