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(8mo ago)19.8k↓51.6%1MITPHPPHP ^8.1

Since Feb 29Pushed 8mo 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 2d 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

39

—

LowBetter than 84% of packages

Maintenance58

Moderate activity, may be stable

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

269d 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

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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