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

27

—

LowBetter than 47% of packages

Maintenance46

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

418d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/136787768?v=4)[Darwin Fotso](/maintainers/darwinnatha)[@darwinnatha](https://github.com/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

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M188](/packages/laravel-ai)[livewire/flux

The official UI component library for Livewire.

9527.8M126](/packages/livewire-flux)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

198321.1k](/packages/fumeapp-modeltyper)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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