doobert/aws-secrets-manager
Larablocks Analysis
doobert/aws-secrets-manager works with Laravel 8 to 13 (latest release v1.0.6, Apr 22, 2026).
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.
- Works with Laravel 13, the current version
- Released in the last 12 months (Apr 22, 2026)
- 1,522 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Maintained- Last stable release: Apr 22, 2026.
- 7 releases in the last 12 months.
- First released: Apr 22, 2026.
- Monthly downloads: 1,522.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require doobert/aws-secrets-manager |
|
| Latest Version: | v1.0.6 |
| PHP: | >=8.0 |
| Laravel: | 8 – 13 |
| License: | MIT |
| Last Updated: | Nov 2, 2026 |
| Links: | GitHub · Packagist |
AWS Secrets Manager for Laravel
Seamless integration with AWS Secrets Manager for Laravel. Caching, atomic locking, flexible config mapping, and easy setup.
🚀 Installation
Install via Composer:
composer require doobert/aws-secrets-manager
If not auto-discovered, add the service provider to config/app.php:
'providers' => [
// ...
Doobert\AWSSecretsManager\AWSSecretsManagerServiceProvider::class,
],
Publish the configuration file:
php artisan vendor:publish --provider="Doobert\\AWSSecretsManager\\AWSSecretsManagerServiceProvider" --tag=config
⚙️ Configuration
Edit config/aws-secrets-manager.php or set these in your .env:
| Key | Description | Default |
|---|---|---|
| enabled | Enable/disable the package | true |
| check_latency | Log cache/AWS latency | false |
| region | AWS region for Secrets Manager | us-west-2 |
| cache_ttl | Cache lifetime (seconds) | 3600 |
| cache_store | Laravel cache store to use (e.g., redis) | redis |
| name | AWS secret name | (empty) |
| log_channel | Log channel for package logs | awssecrets |
| load_in_console | Load secrets when running artisan/console | false |
| keys_raw | Map secret keys to config (see below) | false |
Example .env:
AWS_SECRETS_ENABLED=true
AWS_SECRETS_REGION=us-west-2
AWS_SECRETS_CACHE_TTL=3600
AWS_SECRETS_CACHE_STORE=redis
AWS_SECRETS_NAME=your-secret-name
AWS_SECRETS_LOG_CHANNEL=awssecrets
AWS_SECRETS_LOAD_IN_CONSOLE=false
AWS_SECRETS_KEYS_RAW="DB_PASSWORD:database.connections.mysql.password,API_KEY:services.api.key"
🛠 Usage
Inject or resolve the service:
use Doobert\AWSSecretsManager\AWSSecretsManagerService;
$service = app(AWSSecretsManagerService::class);
$secret = $service->getSecret('your-secret-name');
Mapping Secrets to Config
Mapping Secrets to Config
Set AWS_SECRETS_KEYS_RAW or aws-secrets-manager.keys_raw to map secret keys to Laravel config values:
AWS_SECRETS_KEYS_RAW="DB_PASSWORD:database.connections.mysql.password,API_KEY:services.api.key"
Format: SECRET_KEY:config.path, comma-separated for multiple pairs. This will automatically set config values at runtime.
Load in Console
Set AWS_SECRETS_LOAD_IN_CONSOLE=true to load secrets when running artisan/console commands (disabled by default for performance).
📋 Logging
All logs are sent to the channel defined in log_channel (default: awssecrets). If not set, logs go to the default Laravel log channel.
Refreshing the secrets in Cache
🛡 Artisan Command: Refresh Secrets
You can manually refresh and cache your AWS secret after rotation using the included artisan command:
php artisan doobertaws:secret-refresh
This will force a fresh fetch from AWS Secrets Manager and update the cache. Useful after rotating secrets in AWS.
Options:
--all(future use): Refresh all configured secrets.
Example output:
Refreshing secret: your-secret-name
Secret refreshed and cached in Redis successfully.
Keys available: DB_PASSWORD, API_KEY
If the secret cannot be fetched, you’ll see an error message with troubleshooting tips.
✅ Testing
From the package directory:
composer install
./vendor/bin/phpunit --configuration phpunit.xml
📦 Requirements
- Laravel 8.0+
- PHP 8.0+
- AWS SDK for PHP
📄 License
MIT
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.6 | >=8.0 | ^8.0 || | MIT | |
| v1.0.5 | >=8.0 | ^8.0 || | MIT | |
| v1.0.4 | >=8.0 | ^8.0 || | MIT | |
| v1.0.3 | >=8.0 | ^8.0 || | MIT | |
| v1.0.2 | >=8.0 | ^8.0 || | MIT | |
| v1.0.1 | >=8.0 | ^8.0 || | MIT | |
| v1.0.0 | >=8.0 | >=8.0 | MIT |