Skip to content

Commit

Permalink
docs: remove update interval from document since we don't cache last_…
Browse files Browse the repository at this point in the history
…use_at attribute anymore
  • Loading branch information
abrahamgreyson committed Dec 24, 2023
1 parent 5127834 commit fb8ab33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
这是修正后的文档:

# Let Laravel Sanctum use cache to retrieve token
```markdown
# 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 brings 3 database queries for every HTTP request.
The package wrap the default `PersonalAccessToken` model, uses cache to retrieve the `personal_access_token` and `tokenable` model, and adds a time interval for the `last_used_at` update, the model will be updated only if the time interval is exceeded since the last update. This will reduce 2 or 3 database queries for most requests.
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

Expand All @@ -19,7 +21,7 @@ composer require abe/cache-for-laravel-sanctum

## Usage

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

## Testing

Expand Down

0 comments on commit fb8ab33

Please sign in to comment.