gadixsystem/envwriter is a Laravel package for simple package to write environment.
It currently has 1 GitHub stars and 4.110 downloads on Packagist (latest version v1.1.0).
Install it with composer require gadixsystem/envwriter.
Discover more Laravel packages by gadixsystem
or browse all Laravel packages to compare alternatives.
Last updated
Laravel package to modify .env file.
From your command line run:
composer require gadixsystem/envwriter
Register the provider
In config/app.php add the follow line:
'providers' => [
//EnvWriter
gadixsystem\envwriter\EnvWriterServiceProvider::class,
]
In your controller add the usage statement:
use gadixsystem\envwriter\EnvWriter as Envwriter;
Change the value of a key, if the key does not exist EnvWriter will create a new key with this value, returns true or false. $trim by default is TRUE, if you need to set string with spaces use $trim = FALSE
Check if key exists or not, returns true or false.
Delete specific key, if the key does not exist it returns false
Testing
Run:
vendor/bin/phpunit vendor/gadixsystem/envwriter/src/tests