New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

sven/flex-env

Edit your .env file in Laravel directly from the command line.
97,315 103

Larablocks Analysis

sven/flex-env works with Laravel 6, 7 and 8 (latest release v2.2.2, Dec 21, 2022), all past end of life (the last on Jan 24, 2023): no more fixes, even for security.

Laravel 5 in earlier releases.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 6, 7 and 8, past end of life since Jan 24, 2023
  • No release in the last 12 months (last: Dec 21, 2022)
  • 40 downloads a month (needs 10,000)
  • 103 GitHub stars (at least 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Dec 21, 2022.
  • No releases in the last 12 months.
  • First released: Jan 15, 2016.
  • Monthly downloads: 40, up 400% from six months ago.
  • 6 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require sven/flex-env
Latest Version:v2.2.2
PHP:^7.2 || ^8.0
Laravel:6 · 7 · 8
Older releases:5
License:MIT
Last Updated:Mar 1, 2024
Links: GitHub  ·  Packagist
Maintainer: svenluijten

flex-env

Laravel FlexEnv

Latest Version on Packagist Total Downloads Software License Build Status Code Climate Code Quality StyleCI

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

Via composer:

$ 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.

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

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

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 for this package came from LeShadow's ArtisanExtended.

Contributing

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

License

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

Alternatives to sven/flex-env

imliam/laravel-env-set-command

Set a .env file variable from the command line

373,710 118
syamsoul/laravel-set-env

Easily update or insert Laravel environment variable with Artisan command

59,566 9
msztorc/laravel-env

Laravel env helper commands

63,427 78
tamer-dev/laravel-env-cli

laravel commands to work with .env file in cli

9,710 12

Version History

Version Released PHP Laravel License
v2.2.2 ^7.2 || ^8.0 ^6.0 || ^7.0 || ^8.0 MIT
v2.2.1 ^7.2 || ^8.0 ^6.0 || ^7.0 || ^8.0 MIT
v2.2.0 ^7.2 ^6.0 || ^7.0 MIT
v2.1.2 ^5.5.9 || ^7.0 ^5.0 MIT
2.1.1 ^5.5.9 || ^7.0 ^5.0 MIT
Pre-releases (1)
Version Released PHP Laravel License
v2.0.0-beta ^5.5|^7.0 ~5.1 MIT