Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Env Diff

Laravel Env Diff Laravel Package

romanzipp/laravel-env-diff

A Laravel package for comparing .env files side by side, highlighting missing, extra, and mismatched keys so you can spot configuration drift between environments before it causes deployment surprises.

View on GitHub
Deep Wiki
Context7

Create a visual Diff of .env and .env.example files

Frequently asked questions about Laravel Env Diff
How do I install romanzipp/laravel-env-diff?
Install it as a dev dependency with composer require --dev romanzipp/laravel-env-diff. The package is a single-purpose developer tool that registers a service provider and one Artisan command, so Laravel package auto-discovery handles registration without any config publishing or migrations. If auto-discovery is disabled in your app, register the provider manually in a local or testing-only branch of config/app.php. Keep it out of production images entirely.
Which Laravel and PHP versions does laravel-env-diff support?
The last release was on 2020-03-06, targeting the Laravel 6/7 era, so its illuminate/support and php constraints will likely block installation on Laravel 10/11 with PHP 8.2+. Verify the actual composer.json constraints against your real matrix in a scratch branch before committing to adoption. Do not carry --ignore-platform-reqs workarounds into a shared, governed codebase; if it will not resolve cleanly, treat adoption as off the table.
Does laravel-env-diff print .env values, or does it mask secrets?
Any tool that reads .env and writes to a terminal or CI log is a potential leak vector, so confirm masking behavior before running it in CI. The intended output is a visual diff of keys between .env and .env.example, but you must verify it does not echo values. If it prints values, it cannot run in CI unchanged, and you should restrict it to local workstations or force key-only output.
Can laravel-env-diff fail a CI pipeline when configuration drifts?
Only if the command returns a non-zero exit code on drift, which you must verify rather than assume. Run it in a scratch branch and echo the exit status for both a clean pair of files and a deliberately drifted pair. If it always exits zero, it cannot gate CI, and you would need to wrap it or reimplement the check yourself.
Does laravel-env-diff show missing, extra, and mismatched values, or just key sets?
The package is described as highlighting missing, extra, and mismatched keys between environments, but the depth of the comparison, key presence only versus value-level drift, needs verification against your own files. A hand-rolled parser from 2020 is more likely to compare key sets, which still catches the common 'new env key added to code, forgotten in .env.example' defect class. Test it with a known value-only change to see whether that case is reported.
Should laravel-env-diff be a require-dev dependency?
Yes. It is an architecturally leaf-level console tool that registers a service provider and one command and touches no application domain code, so it adds no runtime risk. Install it with --dev and keep it out of production images. It can be removed again without touching any production paths.
How does laravel-env-diff handle .env edge cases like quotes, comments, and variable interpolation?
Dotenv parsing has meaningful edge cases: quoted values, multi-line values, # comments, escaped $, ${FOO} interpolation, and duplicate keys. A parser written in 2020 may produce false positives on these even when it handles simple files correctly. Validate it against a representative .env containing those constructs before trusting its diff output. If accuracy matters, consider using vlucas/phpdotenv's parser inside a first-party command instead.
Is laravel-env-diff still maintained?
Adoption signals are weak: roughly 8 stars, zero dependents, a single maintainer, and no release since March 2020. That means a bus factor of one and no security response path or upstream fix for problems you find. There is also no evidence of a maintained CI matrix across current Laravel and PHP versions. Many teams conclude that a roughly one-day first-party reimplementation beats owning a fork.
Do I need to publish config or run migrations after installing laravel-env-diff?
No. The package has no config publishing, migrations, queue, or storage surface; it binds one Artisan command via its service provider. Installation is Composer plus, at most, a manual provider registration if auto-discovery is disabled. The real friction is Composer version resolution, not setup steps.
What is the alternative if laravel-env-diff does not support my Laravel version?
Add a small first-party Artisan command that reads both files with vlucas/phpdotenv's parser, applies array_diff_key in both directions, prints a two-column table, and returns exit code 1 on drift. That is roughly a one-day task with zero external dependency and full control over masking and exit codes. Forking the package is the other path, but you take on ongoing ownership of a fork for a trivial feature. Reimplementation usually wins on total cost of ownership.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo