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 today

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 52% 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

1515d ago

Major Versions

v1.1.1 → v2.0.02022-05-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/313402?v=4)[Kaihei Sameshima](/maintainers/kaihei777)[@kaihei777](https://github.com/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.8k9.0M69](/packages/spatie-laravel-responsecache)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M188](/packages/laravel-ai)[illuminate/mail

The Illuminate Mail package.

5910.6M497](/packages/illuminate-mail)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

13314.7k](/packages/nexxai-laravel-cfcache)[kolay/xlsx-stream

Streaming XLSX reader and writer for PHP and Laravel. Constant memory regardless of file size, direct S3 multipart streaming, optional born-indexed random access.

437.9k](/packages/kolay-xlsx-stream)

PHPackages © 2026

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