koel/dotenv-editor
A Laravel package for programmatically reading, updating, and deleting variables in .env files, with backup support and a simple API for managing environment configuration at runtime.
KEY=value lines in a Laravel .env file — is exactly what a setup wizard needs when a customer must enter database credentials, app URL, mail settings, or a license key through a browser instead of editing files over SSH. This is the primary decision it enables: do we invest in a guided install flow, or keep requiring manual server access?.env" half of that feature so you can validate demand before committing to a proper settings architecture.Consider it when:
.env is the source of truth" model and the file is writable by the PHP process — typical of self-hosted Laravel apps distributed to customers who have no DevOps support..env fixtures.Look elsewhere when:
.env at runtime will silently do nothing or fail..env write on node A does not propagate to node B; you need a shared config store.encrypted casts, a settings package (e.g. spatie/laravel-settings), or a managed secrets service are the correct answers..env is a deployment artifact.config:cache) and OPcache are part of your deploy — changing .env requires cache invalidation, which this package does not solve for you.For executives (one paragraph): We have a recurring onboarding bottleneck: customers who self-host our Laravel application need server-level access just to fill in a handful of configuration values, which lengthens implementation and generates support load. A small MIT-licensed library lets the application write those values into its own configuration file from a browser-based setup screen, which would let a non-technical customer complete installation unaided. The library itself is tiny and free, so the cost is a few days of engineering and review rather than a purchase — but because it is a near-abandoned open-source project with negligible adoption, we should copy the code into our own repository and own it rather than depend on it. The scope is deliberately narrow: setup-time and single-server only. It is not a solution for multi-server deployments, runtime settings, or secret management, and we should not let it drift into those roles.
For engineering: This is a narrow utility — read/write/update keys in a .env file — and it is the only credible piece of prior art for the "installer writes config" pattern in Laravel. Expect to vendor it: pin or copy the code, add tests for quoting, escaped characters, comments, duplicate keys, and concurrent-write safety, and keep it behind a single internal service class so it can be swapped for a database-backed settings store later. Two hard constraints to design around from day one: (1) after writing, we must invalidate the config cache and clearly communicate restart/reload requirements; (2) file permissions and container read-only mounts must be detected and surfaced as a friendly error, not a 500. Do not expose this to unauthenticated routes beyond the installer, and never let it write keys outside a known allowlist.
How can I help you explore Laravel packages today?