PHPackages                             farshadth/laravel-dotenv - 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. farshadth/laravel-dotenv

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

farshadth/laravel-dotenv
========================

This is a package to edit .env file

1.1(2y ago)214MITPHPPHP ^8.1

Since Oct 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/farshadth/laravel-dotenv)[ Packagist](https://packagist.org/packages/farshadth/laravel-dotenv)[ Docs](https://github.com/farshadth/laravel-dotenv)[ RSS](/packages/farshadth-laravel-dotenv/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

Laravel DotEnv
==============

[](#laravel-dotenv)

Laravel DotEnv is a simple package for editing .env files in Laravel projects. This package allows you to read, edit, or delete values in the .env file. Additionally, you can copy or move the .env file.

Installation
============

[](#installation)

You can install this package via composer:

```
composer require farshadth/laravel-dotenv
```

Available Methods
=================

[](#available-methods)

> - get()
> - getList()
> - set()
> - setList()
> - delete()
> - deleteList()
> - exists()
> - getFileContent()
> - getOrSet()
> - getAndDelete()
> - copyFile()
> - moveFile()
> - setFilePath()
> - getFilePath()
> - deleteFile()
> - createFile()

Examples
========

[](#examples)

```
use Farshadth\DotEnv\Facades\DotEnv;

DotEnv::get($key);

// get multiple keys
DotEnv::getList(['key1', 'key2'])

DotEnv::set($key, $value);

// set multiple keys and values
DotEnv::setList([
    'key1' => 'value1',
    'key2' => 'value2'
]);

DotEnv::delete($key);

DotEnv::deleteList(['key1', 'key2'])

DotEnv::exists($key);

 // get the content of the .env file
DotEnv::getFileContent();

// get the key and if not exists
// set the key and value
DotEnv::getOrSet($key, $value);

// get the key and delete it
DotEnv::getAndDelete($key);

// copy the .env file to the new path
DotEnv::copyFile($to, $from);

// move the .env file to the new path
DotEnv::moveFile($to, $from);

// set another .env file path to edit that file
// instead of the default .env file
DotEnv::setFilePath($path);

// get the default .env file path,
// if another .env file is set it returns that path
DotEnv::getFilePath();

// delete the .env file
DotEnv::deleteFile($path = null);

// create an empty .env file
DotEnv::createFile($path);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

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

Every ~0 days

Total

2

Last Release

982d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19e16406c6b9678b7c105d12caeea38c641162842ca481eb1cf38d279fb207c5?d=identicon)[farshadth](/maintainers/farshadth)

---

Top Contributors

[![farshadth](https://avatars.githubusercontent.com/u/19472129?v=4)](https://github.com/farshadth "farshadth (16 commits)")

---

Tags

laravellaravel-dotenvfarshadth

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/farshadth-laravel-dotenv/health.svg)

```
[![Health](https://phpackages.com/badges/farshadth-laravel-dotenv/health.svg)](https://phpackages.com/packages/farshadth-laravel-dotenv)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k2](/packages/tapp-filament-form-builder)

PHPackages © 2026

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