allysonsilva/laravel-multienv
Laravel Multienv lets one Laravel installation run with multiple environment files, automatically selecting the right .env per domain or request. Ideal for multi-domain or multi-tenant apps sharing a single codebase, it keeps configuration isolated and manageable without duplicating the application.
.env files and environment switching. It fits applications that need clear separation between local, staging, production, or tenant-specific environments. Because it affects environment resolution, it should be treated as infrastructure-level plumbing rather than a normal feature dependency. v2.1.0’s added support for optimize and optimize:clear is important: it indicates the package now accounts for Laravel’s config/route cache lifecycle, reducing the risk of stale configuration after environment changes.optimize support reduces cache-related risk but does not eliminate it; teams must test optimize, optimize:clear, config:cache, and queue worker restarts after environment switches. The Laravel 9.32 minimum is a compatibility constraint and may force unrelated framework upgrades.APP_ENV resolution, env file precedence, or both? How does it behave with Laravel Octane, queue workers, and scheduled tasks that may boot before or after env switching? Are optimize and optimize:clear covered by automated tests? What is the maintainer’s Laravel major-version support policy? What is the rollback path to a single .env file?.env and config-cache workflows. Teams on older Laravel versions should either remain on v2.0.0 or upgrade Laravel before adopting v2.1.0. The package should sit early in the deployment sequence, before config caching and application boot.php artisan optimize and php artisan optimize:clear behave correctly after switching environments. Promote to production only after CI and staging smoke tests pass..env files, container entrypoints, Laravel Octane, and config-cache warmup scripts. Confirm that optimize support works in the exact deploy pipeline used by the team.optimize and optimize:clear in CI. 5) Update deploy scripts and worker restart procedures. 6) Canary one non-critical service. 7) Document rollback to single-env behavior before broad rollout.optimize/optimize:clear, queue workers holding old configuration, and missing env files falling back to unsafe defaults. Mitigate with preflight checks, explicit env allowlists, post-deploy smoke tests, and mandatory optimize:clear during environment transitions..env and config caching, but this package’s precedence and switching semantics need explicit documentation and examples. TPM should schedule a short enablement session and require integration tests for cache commands before production adoption.How can I help you explore Laravel packages today?