You have a library called vlucas/phpdotenv
that has this responsibility in reading the file .env
.
No% of Laravel has this package configuration.
"require": {
"php": ">=5.6.4",
"ext-mbstring": "*",
"ext-openssl": "*",
"classpreloader/classpreloader": "~3.0",
"doctrine/inflector": "~1.0",
"jeremeamia/superclosure": "~2.2",
"league/flysystem": "~1.0",
"monolog/monolog": "~1.11",
"mtdowling/cron-expression": "~1.0",
"nesbot/carbon": "~1.20",
"paragonie/random_compat": "~1.4|~2.0",
"psy/psysh": "0.7.*",
"ramsey/uuid": "~3.0",
"swiftmailer/swiftmailer": "~5.1",
"symfony/console": "3.1.*",
"symfony/debug": "3.1.*",
"symfony/finder": "3.1.*",
"symfony/http-foundation": "3.1.*",
"symfony/http-kernel": "3.1.*",
"symfony/process": "3.1.*",
"symfony/routing": "3.1.*",
"symfony/translation": "3.1.*",
"symfony/var-dumper": "3.1.*",
"vlucas/phpdotenv": "~2.2"
},
In Laravel in specific its use would be done loading the file in composer.json
in the method just below:
/**
* Register a callback to run after loading the environment.
*
* @param \Closure $callback
* @return void
*/
public function afterLoadingEnvironment(Closure $callback)
{
return $this->afterBootstrapping(
'Illuminate\Foundation\Bootstrap\DetectEnvironment', $callback
);
}
has other related methods too, but this being the primary one.