eznix86/laravel-secrets-loader
Load secrets from external providers into your Laravel config at boot time, keeping credentials out of your .env and source control. Cleanly resolves values from supported secret stores and injects them before your application starts.
composer require eznix86/laravel-secrets-loader. Laravel auto-discovery registers the service provider; v0.3.1 adds an explicit test for composer-autoloader registration, so no manual provider entry is needed on standard Laravel versions.php artisan vendor:publish --tag=secrets-loader-config. This is the first place to look—it defines adapters, secret mappings, and cache behaviour..env (e.g. AWS/GCP/Vault credentials) and set the default adapter in config/secrets-loader.php.database.connections.mysql.password to a remote secret path (e.g. prod/db/password). On boot the package fetches the value and injects it into config, keeping secrets out of source control.read method. Configure one or more adapters and map secret keys to Laravel config keys. Use the default adapter for most cases and named adapters for cross-cloud or migration scenarios.config/secrets-loader.php as config.key => secret.path. The package loads them before the application uses config, so config('database.connections.mysql.password') resolves to the remote value.APP_ENV. Locally, skip remote loading or use a local adapter to avoid cloud calls.php artisan config:cache after secrets are loaded. This keeps deployment pipelines free of hard-coded secrets.register or boot method. If another package reads a secret-backed config value too early, it will see null. Register the secrets loader early or use a bootstrap step.php artisan config:cache will bake resolved secrets into the cached config. Rotating a secret then requires php artisan config:clear (or a cache key change). For frequently rotated secrets, avoid caching the resolved values or use the package’s cache with a short TTL.read method now uses ??= so an already-set config value is preserved. This is useful for local overrides but can mask a failed secret fetch. Check logs if a expected remote value is not applied.??= change means an existing default will win silently—verify your mappings and adapter responses during debugging.dont-discover), you must manually register the service provider.config('secrets-loader') and the resolved config keys. Add temporary logging around the adapter or use php artisan tinker to call the loader manually. Avoid logging secret values.How can I help you explore Laravel packages today?