larament/dot-env-editor
Edit Laravel .env files programmatically with larament/dot-env-editor. Read, update, add, and remove environment variables safely while preserving comments, formatting, and key order. A simple API for managing dotenv values at runtime without clobbering your file.
Consider adoption when:
KEY=value environment entries.Look elsewhere when:
.env as immutable—containers, read-only filesystems, 12-factor platforms—where config should come from environment variables, a database-backed settings system, or a secrets manager..env formatting..env key/value pairs. We would wrap it with an allowlist of editable keys, validation, backup/restore, atomic writes, and audit logging. Recommend a pilot in an internal admin settings screen; avoid production-critical secrets unless hardened. If maintenance becomes a concern, the code is small enough to fork or replace with an internal helper.How can I help you explore Laravel packages today?