Download the PHP package digimax/dot-env-editor without Composer
On this page you can find all versions of the php package digimax/dot-env-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digimax/dot-env-editor
More information about digimax/dot-env-editor
Files in digimax/dot-env-editor
Package dot-env-editor
Short Description Super simple PHP package for updating .env files
License MIT
Informations about the package dot-env-editor
dot-env-editor - A dead simple .env editor for PHP
A robust PHP package designed to simplify the management and manipulation of .env files within your projects. Effortlessly read, write, update, and delete environment variables with ease.
[!IMPORTANT]
If you are looking to load/read environment variables then we highly recommend you vlucas/phpdotenv.
Features 🔥
- Effortlessly load and parse .env files
- Get, set, and remove environment variables
- Support for nesting env vars (e.g. DB_CONNECTION.host)
- Ability to update existing vars or add new ones
- Optionally keep backups of .env files before writing
- Helper methods like
only()
to get subset of variables - Simple chaining methods for a fluent interface
- Handles formatting values like booleans and strings
- Preserves spacing and comments when writing back to the file
- Compatible with various frameworks and environments, ensuring versatility in usage.
- Built for PHP 8+ with strict typing
Requirements
- PHP 8.1 or higher
Installation
Install via Composer:
Usage
You can use chaining methods for a fluent interface 😘
Usage with Laravel 🔥
In your AppServiceProvider
, register DotEnvEditor as a singleton:
In your controller, you can inject the DotEnvEditor
instance and use it to update environment variables:
Do you find this package useful?
If this package has helped to simplify your workflow, consider giving it a ⭐️ on GitHub. Your support encourages further development and improvements! 💖
Support
For support, please open an issue on GitHb or submit a pull request.
License
The MIT License (MIT). Please see License File for more information.