PHPackages                             zamzar/laravel-iam-db-auth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. zamzar/laravel-iam-db-auth

ActivePackage[Authentication &amp; Authorization](/categories/authentication)

zamzar/laravel-iam-db-auth
==========================

AWS IAM db auth package for laravel

1.0.1(4mo ago)0402↑41.7%GPL-3.0-or-laterPHPPHP &gt;=7.3

Since Jan 23Pushed 4mo agoCompare

[ Source](https://github.com/zamzar/laravel-iam-db-auth)[ Packagist](https://packagist.org/packages/zamzar/laravel-iam-db-auth)[ RSS](/packages/zamzar-laravel-iam-db-auth/feed)WikiDiscussions main Synced 3w ago

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

laravel-iam-db-auth
===================

[](#laravel-iam-db-auth)

A Laravel package for connecting to an AWS RDS instance via [IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).

It includes a service provider that gives the framework our overridden MySQL connector class when it asks for a MySQL connection.

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

[](#installation)

Require this package with composer:

```
composer require zamzar/laravel-iam-db-auth
```

Add an `iam` block to your database config, with the following settings:

```
    'mysql' => [
        'driver' => 'mysql',
        'url' => env('DB_URL'),
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'database_name'),
        'username' => env('DB_USERNAME', 'database_username'),
        'password' => env('DB_PASSWORD', ''),
        'unix_socket' => env('DB_SOCKET', ''),
        'charset' => env('DB_CHARSET', 'utf8mb4'),
        'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
        'prefix' => '',
        'prefix_indexes' => true,
        'strict' => true,
        'engine' => null,
        'iam' => [
            'use_iam_auth' => env('DB_USE_IAM_AUTH', false),
            'aws_region' => env('DB_AWS_REGION', 'us-east-1'),
            'cache_store' => env('DB_IAM_CACHE_STORE', 'file'),
        ],
        'options' => extension_loaded('pdo_mysql') ? array_filter([
            PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
        ]) : [],
```

Caching
-------

[](#caching)

AWS RDS auth tokens are valid for up to 15 minutes. This package uses Laravel's caching module to cache tokens for 10 minutes, so that it doesn't have to request a new token for every database connection.

The cache store can be defined via the `iam.cache_store` setting in your database configuration.

Caution

**Do not** use a database cache driver (e.g. `database`) that uses a database connection configured with IAM authentication, as this will cause a recursive loop of the cache driver trying to access the database to retrieve the auth token.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.4% 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 ~19 days

Total

2

Last Release

135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97cf79befff5bf7c2d51ee2ec68668a990b142e45c1949c2fe5df34a1f23e012?d=identicon)[whyleyc](/maintainers/whyleyc)

---

Top Contributors

[![ngoyal16](https://avatars.githubusercontent.com/u/10145666?v=4)](https://github.com/ngoyal16 "ngoyal16 (30 commits)")[![Nawv](https://avatars.githubusercontent.com/u/9863676?v=4)](https://github.com/Nawv "Nawv (7 commits)")[![prakashPixelvide](https://avatars.githubusercontent.com/u/116717615?v=4)](https://github.com/prakashPixelvide "prakashPixelvide (3 commits)")[![dstockhammer](https://avatars.githubusercontent.com/u/1156637?v=4)](https://github.com/dstockhammer "dstockhammer (1 commits)")[![rishiagrawal61](https://avatars.githubusercontent.com/u/31153227?v=4)](https://github.com/rishiagrawal61 "rishiagrawal61 (1 commits)")

### Embed Badge

![Health badge](/badges/zamzar-laravel-iam-db-auth/health.svg)

```
[![Health](https://phpackages.com/badges/zamzar-laravel-iam-db-auth/health.svg)](https://phpackages.com/packages/zamzar-laravel-iam-db-auth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)[pallant/laravel-aws-cognito-auth

An authentication driver for Laravel for authenticating users in AWS Cognito User Pools

777.7k](/packages/pallant-laravel-aws-cognito-auth)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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