snoopycodex/laravel-set-env-fork
Laravel package fork to set or update environment variables in your .env file at runtime. Useful for installers, admin panels, and setup flows that need to persist config changes (APP_URL, DB settings, etc.) without manual editing.
.env, config/cache). No need for external dependencies or complex middleware.php artisan set:env) for developers and DevOps, reducing learning curves.laravel-set-env, with minor updates for compatibility..env files: Does not support alternative configuration backends (e.g., database, Redis, or cloud-based secrets managers)..env files are stored securely (e.g., in .gitignore). Not suitable for highly sensitive data (e.g., database credentials).APP_DEBUG or QUEUE_WORKER_TIMEOUT)..env updates with centralized secrets..env files requires proper filesystem permissions (e.g., chmod 644 .env). Could fail in containerized or immutable deployments (e.g., Docker read-only filesystems)..env (e.g., in CI/CD pipelines) may corrupt the file. No built-in locking mechanism.laravel-set-env. Risk of breaking changes if Laravel core updates affect environment variable handling..env files to version control if not disciplined about .gitignore..env files managed in CI/CD? Are they immutable (e.g., baked into Docker images) or mutable (e.g., mounted volumes)?.env file modifications? This package lacks logging/tracking by default..env files in version control or logs?.env updates could become a bottleneck?.env files in microservices)?.env file parsing)?.env files are manually managed..env file permissions and volume mounts..env usage: Identify variables that are static (no runtime changes) vs. dynamic (candidates for this package)..env files are modified today (e.g., manual edits, scripts) and where this package could automate the process.APP_DEBUG, LOG_LEVEL) in a non-production environment..env edits with php artisan set:env commands (e.g., in GitHub Actions)..env (e.g., chmod 644 .env).staging.DB_HOST, production.QUEUE_DRIVER).config() helper)..env files (e.g., pre-commit hooks to prevent accidental overwrites)..env modification events (e.g., log changes via Laravel events)..env files, using .gitignore).composer require snoopycodex/laravel-set-env-fork)..env file in the deployment environment..env file with a baseline configuration.composer require snoopycodex/laravel-set-env-fork
php artisan vendor:publish --provider="SnoopyCodeX\SetEnv\SetEnvServiceProvider"
.env to .gitignore (if not already present).php artisan set:env KEY=VALUESetEnv facade or service container:
use SnoopyCodeX\SetEnv\Facades\SetEnv;
SetEnv::set('APP_DEBUG', 'true');
- run: php artisan set:env APP_ENV=staging DB_HOST=staging-db.example.com
config('app.env') reflects updates correctly..env file edits in CI/CD or deployments..env files diverging across environments if not managed consistently..env files (e.g., pre-update snapshots) to prevent data loss.How can I help you explore Laravel packages today?