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

ActiveLibrary

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 1mo ago

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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

935d 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

[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[bilfeldt/laravel-request-logger

Log Laravel application request and responses for debugging or statistics

122163.3k2](/packages/bilfeldt-laravel-request-logger)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

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