lundi 28 mai 2018

How to set the laravel environment variable from controller using phpdotenv package

Trying to set the environment variable from controller using phpdotenv package but it throws an error "Call to undefined method Dotenv\Dotenv::setEnvironmentVariable()"

use Dotenv\Dotenv;


   $env = new Dotenv(app()->environmentPath(), app()->environmentFile());
   $env->setEnvironmentVariable('APP_ENV_TEST', 'testing');

Laravel Version: 5.6

vlucas/phpdotenv: 2.4



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire