This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
This package is abandoned and no longer maintained. The author suggests using the absolutehh/dotenv-manipulator package instead.

This package can manipulate the .env file of a laravel project on runtime.

1.2 2017-05-19 13:41 UTC

This package is not auto-updated.

Last update: 2019-02-20 19:10:46 UTC


This package can manipulate the .env file on runtime.

GitHub release GitHub license GitHub issues

StyleCI Code Climate


Add it as dependency to composer composer require absolutehh/dotenv-manipulator and add the \Absolute\DotEnvManipulator\ManipulatorServiceProvider to your config/app.php



use Absolute\DotEnvManipulator\Libs\DotEnv;

$dotenv = new DotEnv('/ma/app/base/path', '.env');
// get current value
$value = $dotenv->get('YOUR_ENV_VAR');
// set and write value
$dotenv->set('YOUR_ENV_VAR', 'new_value')->write();
// sort variables in .env file


php artisan dotenv:get YOUR_ENV_VAR
php artisan dotenv:set YOUR_ENV_VAR --value=new_value