PHPackages                             darwinnatha/env-manager - 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. darwinnatha/env-manager

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

darwinnatha/env-manager
=======================

manage easily other ways env entries

v1.0.0(1y ago)14MITPHPPHP ^8.0CI failing

Since May 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/darwinnatha/env-manager)[ Packagist](https://packagist.org/packages/darwinnatha/env-manager)[ RSS](/packages/darwinnatha-env-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Env Manager
===========

[](#env-manager)

A Laravel package to easily manage .env file entries. This package provides a simple way to read, write, update, and remove environment variables in your Laravel application's .env file.

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

[](#installation)

```
composer require darwinnatha/env-manager
```

Usage
-----

[](#usage)

You can use the package either through the Facade or by instantiating the EnvManager class directly.

### Using the Facade

[](#using-the-facade)

```
use Darwinnatha\EnvManager\Facades\EnvManagerFacade as EnvManager;

// Set or update a variable
EnvManager::set('APP_NAME', 'My Application');

// Remove a variable
EnvManager::remove('UNUSED_VARIABLE');
```

### Using the Class Directly

[](#using-the-class-directly)

```
use Darwinnatha\EnvManager\EnvManager;

$envManager = new EnvManager();

// Set or update a variable
$envManager->set('APP_NAME', 'My Application');

// Remove a variable (static method)
EnvManager::remove('UNUSED_VARIABLE');
```

### Features

[](#features)

- Automatically creates .env file from .env.example if it doesn't exist
- Updates existing variables without affecting other entries
- Adds new variables if they don't exist
- Safely removes variables while preserving file structure
- Supports custom .env file paths
- Maintains proper .env file formatting

### Custom .env Path

[](#custom-env-path)

You can specify a custom path for your .env file:

```
EnvManager::set('APP_NAME', 'My App', '/custom/path/.env');
EnvManager::remove('APP_NAME', '/custom/path/.env');
```

Error Handling
--------------

[](#error-handling)

The package throws exceptions in the following cases:

- When the specified path is a directory
- When neither .env nor .env.example files exist
- When file operations fail

License
-------

[](#license)

MIT

```
This updated README provides:
1. Clear installation instructions
2. Comprehensive usage examples with both Facade and direct class usage
3. Description of key features
4. Documentation for custom path usage
5. Error handling information
6. Proper code examples that match the actual implementation

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

367d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e36313b007c24352d7698e140f37040859bc039d50682ccf3822f94fc042718?d=identicon)[darwinnatha](/maintainers/darwinnatha)

---

Top Contributors

[![darwinnatha](https://avatars.githubusercontent.com/u/136787768?v=4)](https://github.com/darwinnatha "darwinnatha (5 commits)")

---

Tags

managerenv

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/darwinnatha-env-manager/health.svg)

```
[![Health](https://phpackages.com/badges/darwinnatha-env-manager/health.svg)](https://phpackages.com/packages/darwinnatha-env-manager)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[imliam/laravel-env-set-command

Set a .env file variable from the command line

118352.4k10](/packages/imliam-laravel-env-set-command)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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