- How do I install dragon-code/env-sync in a Laravel app?
- Run composer require --dev dragon-code/env-sync and let Laravel package auto-discovery register the Artisan command. No manual service provider registration or migrations are needed. Installation and validation should take well under a day for a typical Laravel project.
- Does dragon-code/env-sync support Laravel 11?
- Release 4.1.0 adds Symfony 7 support, which is the prerequisite for Laravel 11 compatibility. That does not automatically guarantee Laravel 11 support, because the package's illuminate/support and PHP constraints must also allow it. Verify with composer why-not laravel/framework before committing.
- What Artisan command does env-sync add?
- The package registers a single Artisan command through Laravel package auto-discovery, so there is no service provider to wire up manually. After installation, run the command from your project root to compare keys against .env.example. Check the repository README for the exact command signature in your installed version.
- Is it safe to run env-sync in CI?
- CI use is best limited to detecting configuration drift, not fixing it. Running a command that writes .env.example in CI is the one scenario to forbid, because it turns a local annoyance into committed configuration drift. If the package version you install lacks a non-mutating check mode, use a scratch copy of the file and fail the job on differences.
- Will env-sync overwrite existing values in my .env file?
- The package is designed to update environment files safely, adding missing variables and refreshing outdated ones while leaving existing values intact. Because it parses .env as text, test on a copy first and review the diff before trusting it with a complex file. Preserving ordering and formatting depends on the version, so confirm behavior with your own .env.
- How does env-sync handle quoted values, comments, and multiline variables?
- Dotenv files can contain quoted values, inline hash characters, comments, and multiline blobs, which line-based synchronization can mangle or duplicate. Keep .env under local version control or make a backup before running the command. For files with complex values, consider vendoring the key-diff logic and reviewing writes manually.
- Should env-sync be a dev dependency or a production requirement?
- Install it with composer require --dev so it stays out of production builds, and confirm composer install --no-dev excludes it. The package has no request-path service provider logic, migrations, queues, or storage, so its runtime footprint is effectively zero. Keeping it in require-dev documents that it is a development and CI concern.
- How is env-sync different from Laravel's built-in .env loading?
- Laravel loads .env at runtime and resolves configuration values, but it does not reconcile missing keys against .env.example. env-sync is a development-time utility that compares those files and helps new keys propagate to teammates. It is not a secrets manager and does not replace Vault, AWS Secrets Manager, or Kubernetes ConfigMaps.
- Is dragon-code/env-sync actively maintained?
- Release 4.1.0 is a maintainer-authored compatibility update, which is meaningful counter-evidence against the package being abandoned. However, the project has low stars and dependent counts, no visible security response pipeline, and one release does not establish a maintenance cadence. Review commit history and issue response before depending on future updates.
- Can I copy the env-sync command into my app instead of using the package?
- Yes. The package is MIT licensed and the command logic is small enough, roughly a couple hundred lines, that vendoring it into app/Console/Commands is a clean fallback. That route lets you remove the dependency if composer constraints remain tight while keeping the key-diff behavior.