This is a package for env modification the contents of different Laravel projects.
jobmetric/laravel-env-modifier is a Laravel package for this is a package for env modification the contents of different laravel projects..
It currently has 8 GitHub stars and 32 downloads on Packagist (latest version 2.2.1).
Install it with composer require jobmetric/laravel-env-modifier.
Discover more Laravel packages by jobmetric
or browse all Laravel packages to compare alternatives.
Last updated
Manage .env Files. Safely and Easily.
Laravel Env Modifier simplifies working with .env files in Laravel applications. Stop managing environment files manually and start automating configuration management with confidence. It provides a clean API to create, read, merge, update, back up, restore, and delete .env files safely and predictably—perfect for deployment scripts, environment management, and configuration automation. This is where powerful file management meets developer-friendly simplicity—giving you complete control over your environment configuration without the complexity.
Laravel Env Modifier uses atomic writes with LOCK_EX to prevent race conditions when multiple processes access the same .env file. It also includes protection mechanisms to prevent accidental deletion of your main application .env file.
The package automatically handles value normalization, escaping, and quoting. It intelligently quotes values containing spaces, special characters, or newlines, and properly handles booleans, arrays, and JSON data.
Unlike many .env manipulation tools, Laravel Env Modifier preserves comments and blank lines in your .env files. It only modifies the specific keys you target, leaving the rest of your file structure intact.
Work with multiple .env files simultaneously. Create environment-specific files (.env.staging, .env.testing), merge configurations from templates, and manage different environments without code changes.
Env file management is the process of programmatically reading, writing, and modifying environment configuration files. Traditional approaches often involve manual editing or fragile string manipulation, but Laravel Env Modifier provides a robust, safe solution:
.env filesConsider a deployment script that needs to update environment variables based on the deployment environment. With Laravel Env Modifier, you can create environment-specific files, merge configurations from templates, set defaults, create backups before risky operations, and restore if something goes wrong. The power of env file management lies not only in programmatic access but also in making it safe, predictable, and easy to use throughout your application.
By adopting Laravel Env Modifier, you will:
.env protection prevent accidentsInstall Laravel Env Modifier via Composer:
composer require jobmetric/laravel-env-modifier
Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Env Modifier:
The documentation includes:
.env filesThank you for participating in laravel-env-modifier. A contribution guide can be found here.
The laravel-env-modifier is open-sourced software licensed under the MIT license. See License File for more information.