beyondcode/laravel-credentials
Store and manage app credentials like API keys and secrets in the database with encryption. beyondcode/laravel-credentials adds a simple management UI and a Credential model so you can securely retrieve secrets anywhere in your Laravel app.
credentials table, encrypted casting via Laravel's Crypt, a credentials() helper plus facade, and a Blade admin UI guarded by configurable middleware. Rebuilding that shape in-house is roughly one to two engineering days. The decision on the table is "do we want this pattern?", not "do we adopt this code?"APP_KEY-encrypted table is materially harder than designing them in from the start.APP_KEY that protects sessions, means the secret store's blast radius equals the application's blast radius. That is a SOC 2 / PCI / HIPAA-relevant decision and should be made deliberately, not inherited by pulling in a package.encrypted cast or a managed secret store rather than building a roadmap around an upgrade path.Net read: an opportunity score of ~5.8 against a composite of ~2.5 is the classic signature of a good idea shipped once and abandoned. The need is real; this implementation is not the vehicle.
Consider it when:
Look elsewhere when:
APP_KEY means permanent, unrecoverable loss of every stored credential — there is no re-encryption command — and APP_KEY compromise means total exposure.encrypted cast on a first-party model, config fed by a proper injection pipeline (Vault, AWS/GCP Secrets Manager, Doppler, 1Password CLI), or a managed product if rotation and audit are table stakes.Gotchas to carry into the decision: guard all bootstrap-time reads (migrations, seeders, early service providers) behind Schema::hasTable('credentials') or a console check, or fresh installs break; and clear the package cache after every credentials:set, because a terminal write may not be visible to running PHP-FPM workers. Every uncached lookup is a DB query, so resolve once per request or job — never inside a loop, and never in a queued job's constructor, where the value may have rotated and the secret gets serialized into the payload. Missing keys return null silently and keys are case-sensitive, so wrap lookups in an explicit exception. And verify the admin UI's middleware actually requires auth before exposing it — an unauthenticated credentials CRUD screen is a total compromise.
To executives (one paragraph): This is a small open-source Laravel package that stores API keys encrypted in our existing database and lets authorized staff edit them without a deployment — rotating a credential becomes a two-minute admin task instead of an engineering ticket. It is a genuinely useful design pattern, but the project has been unmaintained since October 2020, supports only Laravel 8, and has no dependents. My recommendation is to treat it as a reference design, not a dependency: budget one to two engineering days to build the equivalent in-house on Laravel's native encryption, and separately decide whether production secrets belong in our application database at all.
To engineering (summary): The pattern is worth copying; the code is not worth taking. A thin model with an encrypted cast, a migration, a credentials() helper, and a small guarded admin UI is a day or two of work — and then we own Laravel 9+ compatibility, APP_KEY rotation policy, cache invalidation on write, and an audit trail. If we do build it: namespace keys by environment and tenant, hydrate config at boot behind a console/test guard so the app's call sites stay on config(), resolve credentials inside handle() for queued jobs, and add rotated_at / updated_by before the table is populated rather than after. If someone wants to trial the original in a legacy internal app for low-value sandbox keys only, fine — pin it, vendor it, name an owner, and put a migration ticket next to it on day one.
How can I help you explore Laravel packages today?