This package provides some basic tools for editing dotenv files.
You can install the package via composer:
> composer require sixlive/dotenv-editor
Given we have an existing file at base_path('.env')
.
APP_KEY=supersecret
APP_FOO=BAR
We can add a new section to the existing configuration file.
$editor = new DotenvEditor;
$editor->load(base_path('.env'));
$editor->heading('Examples');
$editor->set('FOO', 'bar');
$editor->set('BAZ', 'bax');
$editor->unset('APP_FOO');
$editor->save();
This will result in the following changes.
APP_KEY=supersecret
# Examples
FOO=bar
BAZ=bax
> vendor/bin/phpunit
StyleCI will apply the Laravel preset.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.