https://github.com/abrahamgreyson/cache-for-laravel-sanctum
cache Laravel Sanctum token
https://github.com/abrahamgreyson/cache-for-laravel-sanctum
cache laravel laravel-framework sanctum
Last synced: 2 months ago
JSON representation
cache Laravel Sanctum token
- Host: GitHub
- URL: https://github.com/abrahamgreyson/cache-for-laravel-sanctum
- Owner: abrahamgreyson
- License: mit
- Created: 2022-05-02T12:22:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T01:11:46.000Z (4 months ago)
- Last Synced: 2025-05-03T23:55:36.730Z (2 months ago)
- Topics: cache, laravel, laravel-framework, sanctum
- Language: PHP
- Homepage:
- Size: 59.6 KB
- Stars: 17
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Let Laravel Sanctum Use Cache to Retrieve Tokens
[](https://packagist.org/packages/abe/cache-for-laravel-sanctum)
[](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/run-tests.yml)
[](https://github.com/abrahamgreyson/cache-for-laravel-sanctum/actions/workflows/php-cs-fixer.yml)
[](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
You can install the package via composer:
```bash
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
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [abraham greyson](https://github.com/abrahamgreyson)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.