PHPackages                             munna/dot-env-editor - 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. munna/dot-env-editor

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

munna/dot-env-editor
====================

Simple package for laravel .env file modification. Now you can handle your .env variable easily.

1.0.0(5y ago)210811MITPHP

Since Jan 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MunnaAhmed/DotEnvEditor)[ Packagist](https://packagist.org/packages/munna/dot-env-editor)[ RSS](/packages/munna-dot-env-editor/feed)WikiDiscussions 1.0.0 Synced today

READMEChangelogDependenciesVersions (3)Used By (1)

[![](https://camo.githubusercontent.com/c88d21a8c8301eee86f0829b17fa07a6f8470cd4efd2ad7d1165024d58c54253/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4d756e6e6141686d65642f446f74456e76456469746f72)](https://github.com/MunnaAhmed/DotEnvEditor/issues)[![](https://camo.githubusercontent.com/0680093a23fb4ac841bda4b6fde2d85dc6ef369db46bc3292bb87d64346dfd11/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f4d756e6e6141686d65642f446f74456e76456469746f72)](https://github.com/MunnaAhmed/DotEnvEditor/network/members)[![](https://camo.githubusercontent.com/9e2c0bb835fc45d558be3b2f589a05e7d6accb7a2800b5f3a28db99980d19763/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d756e6e6141686d65642f446f74456e76456469746f72)](https://github.com/MunnaAhmed/DotEnvEditor/stargazers)[![](https://camo.githubusercontent.com/9a4857922baf1cebd11fc04edc1f0ecffb7bbcb1ff886e3a1c50fa4bc83e9c26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d756e6e6141686d65642f446f74456e76456469746f72)](https://packagist.org/packages/munna/dot-env-editor)

Dot Env Editor
==============

[](#dot-env-editor)

Laravel .env File Moderator

Installing DotEnvEditor
-----------------------

[](#installing-dotenveditor)

Next, run the Composer command to install the latest stable version:

```
composer require munna/dot-env-editor
```

\##After installing, you should follow these two step:

Add this provider link at your config/app.php file into the providers array.

```
Munna\DotEnvEditor\DotEnvEditorServiceProvider::class,
```

And

Add this facades link at your config/app.php file into the aliases array.

```
'DotEnvEditor' => Munna\DotEnvEditor\Facades\DotEnvEditor::class,
```

Create A Class Instance
-----------------------

[](#create-a-class-instance)

to create a class instance

```
use Munna\DotEnvEditor\DotEnvEditor;
$env = new DotEnvEditor();
$env->env_array();
// Use this class as your demand.
```

You can use direct
------------------

[](#you-can-use-direct)

When you are already set the facade class into your aliases array at the config/app.php file.

```
use DotEnvEditor;
$env_array = DotEnvEditor::env_array();
// Example
```

Get The All Variable As Array
-----------------------------

[](#get-the-all-variable-as-array)

```
use DotEnvEditor;
$env_array = DotEnvEditor::env_array();
```

Get The Key Value
-----------------

[](#get-the-key-value)

```
use DotEnvEditor;
$key = "APP_NAME";
$key_val = DotEnvEditor::env_key($key);
```

Check The Key Is Exists or Not
------------------------------

[](#check-the-key-is-exists-or-not)

```
use DotEnvEditor;
$key = "APP_NAME";
$key_check = DotEnvEditor::env_key_check($key);
```

Add a new key
-------------

[](#add-a-new-key)

```
use DotEnvEditor;
$key = "NEW_KEY";
$value = "NEW_VALUE"; // or 1254 or https://www.domain.com
$add_key = DotEnvEditor::add_key($key, $value);
```

Add a new key after any one of existing key
-------------------------------------------

[](#add-a-new-key-after-any-one-of-existing-key)

```
use DotEnvEditor;
$key = "NEW_KEY";
$value = "NEW_VALUE";
$existing_key = "EXISTING_KEY";
$add_key_after = DotEnvEditor::add_key_after($key, $value, $existing_key);
```

Add a new key before any one of existing key
--------------------------------------------

[](#add-a-new-key-before-any-one-of-existing-key)

```
use DotEnvEditor;
$key = "NEW_KEY";
$value = "NEW_VALUE";
$existing_key = "EXISTING_KEY";
$add_key_before = DotEnvEditor::add_key_before($key, $value, $existing_key);
```

Update the existing key
-----------------------

[](#update-the-existing-key)

```
use DotEnvEditor;
$key = "EXISTING_KEY";
$value = "NEW_VALUE";
$update_key = DotEnvEditor::update_key($key, $value);
```

Update multiple existing key
----------------------------

[](#update-multiple-existing-key)

```
$array = [
    "APP_NAME" => "TEST_LARAVEL_APP",
    "MAIL_USERNAME" => "TEST_MAIL_USERNAME",
    "MAIL_PASSWORD" => "TEST_MAIL_PASSWORD",
];
$env = DotEnvEditor::update_multiple_key($array);
return $env;
```

Remove the existing key
-----------------------

[](#remove-the-existing-key)

```
use DotEnvEditor;
$key = "EXISTING_KEY";
$remove_key = DotEnvEditor::remove_key($key);
```

Full Env File As An Indexing Array
----------------------------------

[](#full-env-file-as-an-indexing-array)

```
use DotEnvEditor;
$env_array = DotEnvEditor::env_file();
```

Env Row File As String
----------------------

[](#env-row-file-as-string)

```
use DotEnvEditor;
$env_row_file = DotEnvEditor::env_row_file();
```

License
-------

[](#license)

This package is open-sources and licensed under the [MIT license](https://opensource.org/licenses/MIT).

Thank you very much. Please give a star.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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

Every ~0 days

Total

2

Last Release

1998d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/94953474?v=4)[MunnaAhmed](/maintainers/MunnaAhmed)[@munnaahmed](https://github.com/munnaahmed)

---

Top Contributors

[![dev-munna](https://avatars.githubusercontent.com/u/56052563?v=4)](https://github.com/dev-munna "dev-munna (11 commits)")[![munnaweber](https://avatars.githubusercontent.com/u/36112694?v=4)](https://github.com/munnaweber "munnaweber (2 commits)")

### Embed Badge

![Health badge](/badges/munna-dot-env-editor/health.svg)

```
[![Health](https://phpackages.com/badges/munna-dot-env-editor/health.svg)](https://phpackages.com/packages/munna-dot-env-editor)
```

###  Alternatives

[tomasnorre/crawler

Crawler extension for TYPO3

57428.7k1](/packages/tomasnorre-crawler)[piphp/gpio

A library for accessing the GPIO pins on a Raspberry Pi

4315.9k2](/packages/piphp-gpio)

PHPackages © 2026

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