PHPackages                             sven/flex-env - 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. [CLI &amp; Console](/categories/cli)
4. /
5. sven/flex-env

ActiveLibrary[CLI &amp; Console](/categories/cli)

sven/flex-env
=============

Edit your .env file in Laravel directly from the command line.

v2.2.2(3y ago)10297.2k12[2 issues](https://github.com/svenluijten/flex-env/issues)[1 PRs](https://github.com/svenluijten/flex-env/pulls)MITPHPPHP ^7.2 || ^8.0CI failing

Since Jan 15Pushed 2y ago2 watchersCompare

[ Source](https://github.com/svenluijten/flex-env)[ Packagist](https://packagist.org/packages/sven/flex-env)[ RSS](/packages/sven-flex-env/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (0)

[![flex-env](https://cloud.githubusercontent.com/assets/11269635/12526309/85a09084-c16c-11e5-8099-cddf6f8fce78.jpg)](https://cloud.githubusercontent.com/assets/11269635/12526309/85a09084-c16c-11e5-8099-cddf6f8fce78.jpg)

Laravel FlexEnv
===============

[](#laravel-flexenv)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5c093cd5a881d199bd05913fcbfffcd4002cba6c4de22cf98903a672601aa991/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7376656e2f666c65782d656e762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/flex-env)[![Total Downloads](https://camo.githubusercontent.com/0816066d48dfda05a782c87e88d2e8630cff5d9bd064f087afee15c53b1c4072/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7376656e2f666c65782d656e762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/flex-env)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/f0ea10dfd4fd59f36802d4bbcd0655f4ec56bf4ab9e8cd96750ca2f5db3a7830/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7376656e6c75696a74656e2f666c65782d656e762e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/svenluijten/flex-env)[![Code Climate](https://camo.githubusercontent.com/fc46e786b26d5de928430af5d54c772fdce3cc41045fd8f0dddabde6844319e1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f7376656e6c75696a74656e2f666c65782d656e762e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/svenluijten/flex-env)[![Code Quality](https://camo.githubusercontent.com/c09af4e9504b7e23fab9fe3d088d2232528e757e44d642236d9bc80bbdbafcb6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7376656e6c75696a74656e2f666c65782d656e762e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/svenluijten/flex-env/?branch=master)[![StyleCI](https://camo.githubusercontent.com/26c8dc8cf4946f5e28949c891ac594f340c39bd3461976dd1216df990bf41aea/68747470733a2f2f7374796c6563692e696f2f7265706f732f34393634343738312f736869656c64)](https://styleci.io/repos/49644781)

This package adds a handful of useful commands to edit your `.env` file in Laravel directly from the command line with a simple, human readable API. Never touch the mouse again!

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

[](#installation)

Via [composer](http://getcomposer.org):

```
$ composer require sven/flex-env --dev
```

Alternatively, add the package to your dev dependencies in `composer.json` and run `composer update` afterwards:

```
{
    "require-dev": {
        "sven/flex-env": "^2.0"
    }
}
```

**Note:** If you're using Laravel 5.5, you're done! The service provider is automatically registered in the container, thanks to [auto-discovery](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518).

Next, add the `FlexEnvServiceProvider` to your `providers` array in `config/app.php`:

```
// config/app.php
'providers' => [
    ...
    Sven\FlexEnv\FlexEnvServiceProvider::class,
]
```

Usage
-----

[](#usage)

The commands in this package should now be registered. Simply run `php artisan`, and you will see them in the list.

```
# Create or edit an entry in your .env file:
$ php artisan env:set {key} {value} [--line-break|-L]
# Add the --line-break (or -L) option to insert a line break before the entry.
```

```
# Delete an entry from your .env file:
$ php artisan env:delete {key}
```

```
# Show the value of the given key from your .env file:
$ php artisan env:get {key}
```

```
# Show the entire .env file:
$ php artisan env:list
```

All changes you made should now be reflected in your `.env` file.

Inspiration
-----------

[](#inspiration)

Inspiration for this package came from [LeShadow's ArtisanExtended](https://github.com/LeShadow/ArtisanExtended).

Contributing
------------

[](#contributing)

All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the [CONTRIBUTING.md](CONTRIBUTING.md) first, though. See the [contributors page](../../graphs/contributors) for all contributors.

License
-------

[](#license)

`sven/flex-env` is licensed under the MIT License (MIT). See the [license file](LICENSE.md)for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 90.4% 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 ~212 days

Recently: every ~443 days

Total

14

Last Release

1011d ago

Major Versions

v1.0.0 → v2.0.0-beta2016-01-23

PHP version history (5 changes)v2.0.0-betaPHP ^5.5|^7.0

v2.0.2PHP ^5.5.9 || ^7.0

v2.2.0PHP ^7.2

v2.2.1PHP ^7.2 || ^8.0

2.x-devPHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6682e025b83b7a93b4d43c5c9b0b2245d790d72352758c47b81ba14858f45a8a?d=identicon)[svenluijten](/maintainers/svenluijten)

---

Top Contributors

[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (85 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (5 commits)")[![jamosaur](https://avatars.githubusercontent.com/u/4105611?v=4)](https://github.com/jamosaur "jamosaur (3 commits)")[![Pezhvak](https://avatars.githubusercontent.com/u/3134479?v=4)](https://github.com/Pezhvak "Pezhvak (1 commits)")

---

Tags

artisanenvironment-variableshacktoberfestlaravelpackagelaravelartisanenvFlexible

### Embed Badge

![Health badge](/badges/sven-flex-env/health.svg)

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

###  Alternatives

[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[tamer-dev/laravel-env-cli

laravel commands to work with .env file in cli

126.5k](/packages/tamer-dev-laravel-env-cli)[socialengine/sniffer-rules

A Lumen 5 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

1248.2k1](/packages/socialengine-sniffer-rules)[sunaoka/laravel-facade-generator

Provide command line generation of facade layer files.

171.9k](/packages/sunaoka-laravel-facade-generator)

PHPackages © 2026

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