abe / cache-for-laravel-sanctum
Let Laravel Sanctum use cache to retrieve token
Installs: 6 342
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: ^8.0
- illuminate/cache: ^8.0|^9.0|^10.0
- laravel/sanctum: ^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.7
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
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.