Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T00:43:21.000Z (5 months ago)
- Last Synced: 2024-09-29T11:45:22.921Z (about 2 months ago)
- Topics: cache, laravel, laravel-framework, sanctum
- Language: PHP
- Homepage:
- Size: 72.3 KB
- Stars: 16
- Watchers: 3
- Forks: 5
- 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
[![Latest Version on Packagist](https://img.shields.io/packagist/v/abe/cache-for-laravel-sanctum.svg?style=flat-square)](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://img.shields.io/packagist/dt/abe/cache-for-laravel-sanctum.svg?style=flat-square)](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.