dragon-code/env-sync
Synchronize Laravel .env files with .env.example using Dragon Code Env Sync. It detects missing or outdated variables, updates environment files safely, and helps keep local, staging, and team configurations consistent. Run it locally or in CI to prevent config drift.
.env.example drifting from the real .env — is a recurring onboarding tax: new engineers clone, copy the example, and hit opaque MissingAppKeyException/null-config failures. A sync command turns a 30–60 minute debugging session into a one-line php artisan env:sync..env keys against .env.example, append missing ones), and now only lightly maintained, the real decision is not "adopt this dependency" but "vendor/fork ~100 lines of it into our skeleton" versus "write it ourselves in an afternoon." Either is defensible; taking it as a live Composer dependency is still not.post-create-project-cmd script so every new repo starts with a trustworthy example file — a cheap, visible DX win.--dry-run/exit code) wired into CI: fail the build when a key added to config/*.php or .env is absent from .env.example. That converts a documentation hygiene problem into an enforceable gate, which is the decision-worthy part, not the file writing itself..env management on VMs or Forge-style hosts.Consider it (as a fork or vendored reference implementation) when:
.env is genuinely the config source of truth, and onboarding friction or "works on my machine" config bugs are a measured, recurring complaint.Look elsewhere when:
composer.json that ships to production — and do not read 4.1.0 as evidence that the archive status has been reversed..env files must never run in CI against real secrets; prefer an explicit allowlist-based script or your platform's config management (Vault, Doppler, AWS App Config, Laravel Vapor/Envoyer secrets)..env ↔ one .env.example..env files are an anti-pattern.To executives: This is a small developer-experience utility that keeps the sample environment file in sync with the real one, reducing new-hire setup time and a class of "missing config" bugs that show up as failed deploys or broken local setups. Cost is negligible — roughly one engineer-day. There was a new release (4.1.0) adding Symfony 7 compatibility, which keeps it usable on current Laravel 11 stacks — but it is a single compatibility commit on a project that has otherwise been quiet and carries no meaningful user base. So the recommendation is unchanged: reimplement the behavior in-house (~1 day) rather than take a dependency, capturing the benefit while avoiding thinly maintained third-party code in our supply chain. Expected return is modest but real: faster onboarding and fewer config-related support requests, with no vendor lock-in and no licensing cost under MIT.
To engineering: Treat dragon-code/env-sync as a specification, not a dependency — and treat 4.1.0 (Symfony 7 support only; no new behavior, no breaking changes, no API surface change) as confirmation of scope, not as a reason to re-evaluate adoption. We copy the two behaviors worth having — (1) append keys present in .env but missing from .env.example, and (2) a non-destructive diff/validate mode that exits non-zero — into an internal artisan command, then wire the validate mode into CI. Keep it read-only by default in pipelines, never let it touch real secrets, and require a human-reviewed commit for any rewrite of .env.example. If a team wants the upstream package anyway, pin the exact version (4.1.0), isolate it to require-dev, and accept that we own the patches — the Symfony 7 line is now covered, but nothing after it is promised.
How can I help you explore Laravel packages today?