Package to automatically include .env via vlucas/phpdotenv
in your yii2 application.
composer require brixms/yii2-phpdotenv
- edit
index.php
or youryii
entry points to includeDotenv
(after autoload has been required):
(new \Dotenv\Dotenv("your full .env file location"))->overload();