PHPackages                             bmaximilian/laravel-env-overloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bmaximilian/laravel-env-overloader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bmaximilian/laravel-env-overloader
==================================

A Dotenv extension to use multiple environment config files

1.0.0(6y ago)13.7kMITPHPPHP ^7.1CI failing

Since Sep 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bmaximilian/laravel-env-overloader)[ Packagist](https://packagist.org/packages/bmaximilian/laravel-env-overloader)[ RSS](/packages/bmaximilian-laravel-env-overloader/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

laravel-env-overloader
======================

[](#laravel-env-overloader)

[![Build Status](https://camo.githubusercontent.com/143474907b18b19d36ca06fcde1d14c06776374be39255756fa7c84c9877fbbb/68747470733a2f2f636972636c6563692e636f6d2f67682f626d6178696d696c69616e2f6c61726176656c2d656e762d6f7665726c6f616465722e7376673f7374796c653d737667)](https://circleci.com/gh/bmaximilian/laravel-env-overloader)[![Latest Stable Version](https://camo.githubusercontent.com/f1af71c7fe19b2b0f07195a13082ae2f6756fc5dbc20c98260a33c5d0e9ed0c7/68747470733a2f2f706f7365722e707567782e6f72672f626d6178696d696c69616e2f6c61726176656c2d656e762d6f7665726c6f616465722f762f737461626c652e737667)](https://packagist.org/packages/bmaximilian/laravel-env-overloader)[![License](https://camo.githubusercontent.com/158867ca2597683d77c987dc7a4bef390be003702fc82e525a0d15c2cadb354a/68747470733a2f2f706f7365722e707567782e6f72672f626d6178696d696c69616e2f6c61726176656c2d656e762d6f7665726c6f616465722f6c6963656e73652e737667)](https://packagist.org/packages/bmaximilian/laravel-env-overloader)

A Dotenv extension to use multiple environment config files.

Environment overloading can be useful when dealing with local environment variables (such as APP\_KEY) or when dealing with secrets that should not be committed to your repository.

Installation
------------

[](#installation)

### Install with composer

[](#install-with-composer)

```
composer require bmaximilian/laravel-env-overloader
```

### Overload the environment with multiple env files

[](#overload-the-environment-with-multiple-env-files)

Paste the following code in your `bootstrap/app.php`

```
$env = $app->detectEnvironment(function() {
    MaximilianBeck\Environment\Overloader\EnvironmentOverloader::overload();
});
```

### Use commands to generate a simple .env file

[](#use-commands-to-generate-a-simple-env-file)

If you are on Laravel &lt; 5.4: Add the following provider to your `$providers` in `config/app.php`

```
MaximilianBeck\Environment\Overloader\Console\Providers\EnvironmentConsoleServiceProvider::class,
```

For newer Laravel versions, this service provider should be auto-discovered.

Usage
-----

[](#usage)

Create .env Files in the root directory of your Laravel application. The `.env.base` File can be created for configuration that should be the same for all environments (e.g. feature flags). The `.env.${APP_ENV}` File is loaded for all specific configurations for the currently deployed environment. You can also pass an array of file names to the `EnvironmentOverloader::overload()` as first argument for more custom environment files. The standard `.env` File is loaded as master which overrides other files.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2428d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3e2dbbf8820a98cc760f7340b2ec93321c51852b494e06aa4a4dc3a4225c0a8?d=identicon)[bmaximilian](/maintainers/bmaximilian)

---

Top Contributors

[![bmaximilian](https://avatars.githubusercontent.com/u/24223521?v=4)](https://github.com/bmaximilian "bmaximilian (14 commits)")

---

Tags

laravelenvironmentenvdotenvOverload

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bmaximilian-laravel-env-overloader/health.svg)

```
[![Health](https://phpackages.com/badges/bmaximilian-laravel-env-overloader/health.svg)](https://phpackages.com/packages/bmaximilian-laravel-env-overloader)
```

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[msztorc/laravel-env

Laravel env helper commands

7855.4k](/packages/msztorc-laravel-env)[diarmuidie/envpopulate

Tool to interactively populate a `.env` file based on an `.env.example` file whenever Composer installs or updates.

1892.0k](/packages/diarmuidie-envpopulate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
