PHPackages                             kaihei777/laravel-aws-cache-adapter - 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. kaihei777/laravel-aws-cache-adapter

ActiveLibrary[Caching](/categories/caching)

kaihei777/laravel-aws-cache-adapter
===================================

Laravel Cache Adapter for AWS Credential Caching. Allows you to reduce calls to the ec2 metadata api.

v2.0.0(4y ago)04MITPHP

Since Apr 29Pushed 4y agoCompare

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

READMEChangelogDependencies (9)Versions (9)Used By (0)

laravel-aws-cache-adapter
=========================

[](#laravel-aws-cache-adapter)

> Provides an `Aws\CacheInterface\CacheInterface` compliant cache for the AWS SDK which uses the laravel Cache classes.

[![Latest Version on Packagist](https://camo.githubusercontent.com/231082354f5c9117d749c5f18531c1ae0c0fcca81cb3041e47740e45e9708c18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukewaite/laravel-aws-cache-adapter)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/fd7f4d9c1f40bae0817c1b7c4b54cae4d5b640d2b4358ec2273723c231aea610/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lukewaite/laravel-aws-cache-adapter)[![Code Coverage](https://camo.githubusercontent.com/4b3465842713b85c7559f19ac3b8b44f850434cf7a74411ea3ffe1135528eaed/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c756b6577616974652f6c61726176656c2d6177732d63616368652d616461707465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lukewaite/laravel-aws-cache-adapter/?branch=master)

### Purpose

[](#purpose)

When using EC2 Instance IAM Roles or ECS Task IAM Roles the AWS php sdk automatically performs lookups against the ec2 metadata api (169.254.169.254) to get credentials. These by default are not cached, and can occasionally be a source of trouble or slowdowns if the metadata api is slow/not responding.

This package allows you to configure certain laravel filesystems to be automatically loaded with a `CacheInterface` that will use a laravel cache store to cache the STS tokens returned, reducing requests to the metadata api.

Usage
=====

[](#usage)

### Direct Usage of the Adapter

[](#direct-usage-of-the-adapter)

The `LaravelCacheAdapter` can be passed directly into Flysystem in your `config/filesystems.php`

```
    's3' => [
        'driver'      => 's3',
        'base-path'   => 'https://s3.amazonaws.com',
        'credentials' => new LaravelCacheAdapter(app('cache'))
        'bucket'      => env('AWS_BUCKET'),
        'region'      => env('AWS_REGION', 'us-east-1'),
    ],

```

### Auto Insertion of the CredentialProvider via ServiceProvider

[](#auto-insertion-of-the-credentialprovider-via-serviceprovider)

The default configuration settings are in `/config/laravel-aws-cache.php`. Copy this file to your own config directory to modify the values. You can publish this config using this command:

```
$ php artisan vendor:publish --provider="LukeWaite\LaravelAwsCacheAdapter\ServiceProvider"

```

#### Configuration

[](#configuration)

```
return [
    /**
     * A comma separated list of filesystems defined in `config/filesystems.php` to which the
     * credential cache should be applied.
     */
    'filesystems' => env('LARAVEL_AWS_CACHE_FILESYSTEMS', null),

    /**
     * Whether or not to iterate through the `filesystems` defined and apply the credential cache.
     */
    'enable' => env('LARAVEL_AWS_CACHE_ENABLE', false),

    /**
     * The Laravel cache store defined in `config/cache.php` to use.
     */
    'cache' => env('LARAVEL_AWS_CACHE_CACHE', 'file')
];

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% 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 ~458 days

Total

5

Last Release

1465d ago

Major Versions

v1.1.1 → v2.0.02022-05-09

### Community

Maintainers

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

---

Top Contributors

[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (16 commits)")[![bpw-sameshima](https://avatars.githubusercontent.com/u/197540568?v=4)](https://github.com/bpw-sameshima "bpw-sameshima (3 commits)")

---

Tags

laravelawscacheiamcredential

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kaihei777-laravel-aws-cache-adapter/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)[karriere/state

Laravel package for storing current application state in cache/session

1718.5k](/packages/karriere-state)

PHPackages © 2026

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