.env files synchronized with application configuration (e.g., config/, database.php, queue.php). This is particularly valuable for:
.env.example and actual configs causes onboarding friction.composer require worksome/envy --dev), and the core functionality (php artisan envy:sync) requires no additional setup for basic use.envy.php config file, allowing TPMs to define:
app.php)..env.staging vs. .env.prod)..env files before running tests)..env against config before merging to prod)..env (e.g., commented-out values, deprecated keys). Mitigation: Customize sync_rules in the config to exclude noisy paths or use regex patterns.APP_KEY, database passwords) from config to .env could inadvertently expose them in version control if .env is committed. Mitigation:
.env.example as the target (not .env).ignore rules.laravel/env-editor or vlucas/phpdotenv for runtime secret management.config/app.php) may slow down the sync command. Mitigation: Pre-configure scan_files to target only relevant configs (e.g., config/database.php)..env.example be the only target (for onboarding), or should we sync to .env for local dev consistency?.env.staging vs. .env.prod)?DB_PASSWORD) stored in config files, or are they managed externally (e.g., AWS Secrets Manager)?laravel/env-editor to mask secrets in .env.example?envy:sync run as a pre-test step to validate .env files?.env files are dynamically generated (e.g., by Terraform)?register() and boot()..env files from config..env files are frequently edited.envy:sync as a validation step in CI to catch drift early.php artisan envy:publish to customize the config.config/database.php).envy:sync to pre-commit hooks for the team..env is out of sync).scan_files incrementally (e.g., add config/queue.php after validating database sync).envy:sync as part of their setup.ignore rules..env Files: The package won’t overwrite existing .env files by default; it appends or updates missing values. Risk: Conflicts if .env contains manual overrides. Mitigation: Use --force cautiously or merge strategies.config/custom.php), ensure these paths are included in scan_files.scan_files to avoid scanning unrelated configs..env.example and config files for drift..env.example for onboarding, .env for local dev).composer require worksome/envy --dev.php artisan envy:publish.scan_files, sync_rules, and ignore patterns in config/envy.php.'scan_files' => [
config_path('database.php'),
config_path('queue.php'),
],
'ignore' => [
'app.key',
'services.*',
],
php artisan envy:sync --dry-run to preview changes.php artisan envy:sync --force in a safe environment.composer.json scripts:
"scripts": {
"post-install-cmd": [
"php artisan envy:sync --dry-run"
]
}
- name: Sync env files
run: php artisan envy:sync --force
config/database.php), reducing duplication and improving maintainability..env must be reflected in config or vice versa.worksome/envy alongside Laravel major versions.config/envy.php may grow complex. Document rules and consider splitting into modular configs (e.g., envy/database.php).php artisan envy:sync to auto-generate a working .env from .env.example and config.How can I help you explore Laravel packages today?