romanzipp/laravel-env-normalizer
A Laravel package that normalizes your .env file, tidying key ordering and formatting so environment configs stay consistent across projects and teams. Useful for keeping diffs clean and avoiding merge conflicts in shared .env files.
KEY=value line in .env.example is effectively a configuration knob you've shipped. This package makes the knobs explicit by diffing real .env files against the canonical example, which supports decisions like "how many settings do we actually expose?", "which flags are vestigial?", and "what's the default a self-hoster will land on?".env but absent from .env.example (and vice versa), it gives you evidence for removing dead feature flags, retired integrations, and orphaned credentials — a prerequisite for reducing secret sprawl and audit scope..env layout instead of a hand-rolled one. That's a measurable reduction in "it works on my machine" triage and in setup tickets to platform/DevOps..env.example authoritative means upgrade notes ("add QUEUE_BATCH_SIZE to your env") are mechanically verifiable rather than prose-only. This supports build-vs-buy calls on internal tooling: a small script vs. a dependency..env.example is out of sync with usage" can become a failing check rather than a code-review nit. That converts a soft convention into an enforceable policy, which is a governance decision worth making explicitly.Adopt it when:
.env.example that has visibly rotted..env.example as documentation and want that documentation validated in CI.Look elsewhere, or don't adopt, when:
.env files by hand. If configuration lives in Vault, AWS SSM, Doppler, Kubernetes ConfigMaps/Secrets, Laravel Vapor, or Forge's env editor, the file-normalization premise mostly evaporates. You'd want drift detection at the config provider layer instead.make env-check script covers the same ground with zero dependency risk.Given the score and staleness, the realistic PM position is "borrow the idea, not necessarily the dependency" — evaluate it inside a spike, and be prepared to reimplement the diff as an internal command.
To executives: This is a small hygiene tool, not a platform bet. It keeps our environment configuration files consistent and tells us which settings are actually used versus dead, which shortens new-engineer setup and shrinks the surface area we have to audit for secrets and stale credentials. Cost is negligible and it never runs in production. The caveat: the upstream project is effectively unmaintained (last release 2021, no adoption), so treat it as a pattern we may adopt internally rather than a long-term vendor.
To engineering: The package reformats .env to match .env.example's key order and grouping, and reports keys that exist in one but not the other. That gives us a mechanical answer to "did this PR add a setting without documenting it?" and "is this flag still live?" — ideal as a CI check or a pre-release step. It's a dev-only dependency, MIT-licensed, and small enough to fork or reimplement as an Artisan command if compatibility or maintenance becomes a problem. Recommend a time-boxed trial: one environment, one CI job, measure whether the drift reports surface real cleanup work before we standardize on it.
How can I help you explore Laravel packages today?