PHPackages                             rgout/laravel-passport-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. rgout/laravel-passport-cache

ActiveLibrary[Caching](/categories/caching)

rgout/laravel-passport-cache
============================

Caches the laravel/passport tokens

v1.2.0(7mo ago)19.0k↓40.6%1MITPHPPHP ^8.1

Since Feb 29Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/rdgout/laravel-passport-cache)[ Packagist](https://packagist.org/packages/rgout/laravel-passport-cache)[ RSS](/packages/rgout-laravel-passport-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Laravel Passport Cache
======================

[](#laravel-passport-cache)

This package provides a seamless caching layer for Laravel Passport, enhancing the performance of OAuth2 operations by caching access tokens, clients, and personal access tokens. It's designed for applications using Laravel Passport for authentication, aiming to reduce database load and improve response times.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require rdgout/laravel-passport-cache
```

Configuration
-------------

[](#configuration)

Publish the package configuration to customize cache settings:

```
php artisan vendor:publish --provider="RGout\LaravelPassportCache\CacheServiceProvider"
```

This command publishes a configuration file to `config/passport-cache.php`, where you can adjust the cache settings.

Usage
-----

[](#usage)

Once installed, the package automatically hooks into Laravel Passport's existing mechanisms. No further action is required for basic caching functionality.

To customize the caching behavior or to manually cache items, refer to the documentation below.

### Customizing Cache Times

[](#customizing-cache-times)

#### `client_ttl`

[](#client_ttl)

- **Description**: Sets the cache time to live (TTL) for OAuth clients in seconds.
- **Default**: `300` seconds.
- **Why Customize**: This value is used for every request involving client details. Since OAuth client details are less likely to change frequently, caching them for a slightly longer duration can improve performance without significantly increasing the risk of stale data.

#### `token_ttl`

[](#token_ttl)

- **Description**: Sets the cache TTL for access tokens in seconds.
- **Default**: `60` seconds.
- **Why Customize**: Access tokens are frequently validated in your application. Setting an appropriate TTL can help reduce database load by caching token validation responses.

#### `refresh_token_ttl`

[](#refresh_token_ttl)

- **Description**: Sets the cache TTL for refresh tokens in seconds.
- **Default**: `60` seconds.
- **Why Customize**: Similar to access tokens, caching refresh tokens can improve the efficiency of token refresh operations. Consider adjusting this value based on your application's security requirements and refresh token usage patterns.

By customizing these settings, you can tailor the caching behavior of Laravel Passport to match the specific needs and traffic patterns of your application, balancing performance improvements with data freshness and security considerations.

### Clearing Cache

[](#clearing-cache)

There is no specific command to clear the cache for Laravel Passport. Instead, you can use Laravel's built-in cache clearing commands to clear the cache for Laravel Passport Cache:

```
php artisan cache:clear
```

Security
--------

[](#security)

If you discover any security-related issues, please use the issue tracker.

Contributing
------------

[](#contributing)

Contributions are welcome but please ensure to follow the [contributing guidelines](CONTRIBUTING.md).

License
-------

[](#license)

The Laravel Passport Cache is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance63

Regular maintenance activity

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~293 days

Total

3

Last Release

223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dff24cf0375feb37fe4d59568b1c90dcbe31a1132409fae18fe713d68cce0903?d=identicon)[rdgout](/maintainers/rdgout)

---

Top Contributors

[![rdgout](https://avatars.githubusercontent.com/u/4692202?v=4)](https://github.com/rdgout "rdgout (9 commits)")

### Embed Badge

![Health badge](/badges/rgout-laravel-passport-cache/health.svg)

```
[![Health](https://phpackages.com/badges/rgout-laravel-passport-cache/health.svg)](https://phpackages.com/packages/rgout-laravel-passport-cache)
```

###  Alternatives

[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202541.1k6](/packages/swayok-alternative-laravel-cache)[alexmg86/laravel-sub-query

Laravel subquery

7538.4k](/packages/alexmg86-laravel-sub-query)[byerikas/cache-tags

Allows for Redis/Valkey cache flushing multiple tagged items by a single tag.

1413.9k](/packages/byerikas-cache-tags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
