morainstein / dotenv
A simple lib for loading environment variables in PHP
1.0.0
2025-07-29 17:08 UTC
README
A simple way to use your environment variables in PHP
Getting Started
composer require morainstein/dotenv
use Morainstein\DotEnv; //You may also ommit the $envFilePath param, so it finds the .env in the working directory of application $dotenv = new DotEnv($envFilePath); //Just simple as it looks! $envValue = $dotenv->get('envKey')
Recomendation
Load the DotEnv class in your bootstrap file, then use it everywhere in your application