gadixsystem / envwriter
Simple package to write environment
Installs: 1 098
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.1.3|^8.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-05-23 23:16:45 UTC
README
Laravel package to modify .env file.
Installation:
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,
]
Basic usage
In your controller add the usage statement:
use gadixsystem\envwriter\EnvWriter as Envwriter;
Methods
- EnvWriter::change($key,$value,$trim)
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
- EnvWriter::exists($key)
Check if key exists or not, returns true or false.
- EnvWriter::delete($key)
Delete specific key, if the key does not exist it returns false
Testing
Run:
vendor/bin/phpunit vendor/gadixsystem/envwriter/src/tests