New

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

krasomir/laravel-env-set-command

This package create command to set value to .env key.
3,566

Larablocks Analysis

krasomir/laravel-env-set-command works with Laravel 10 to 13 (latest release v2.1.0, Apr 21, 2026).

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Apr 21, 2026)
  • 99 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Apr 21, 2026.
  • 2 releases in the last 12 months.
  • First released: Nov 1, 2023.
  • Monthly downloads: 99.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require krasomir/laravel-env-set-command
Latest Version:v2.1.0
PHP:^8.2|^8.3|^8.4
Laravel:10 – 13
License:MIT
Last Updated:Jun 22, 2026
Links: GitHub  ·  Packagist
Maintainer: kmioc

This package create command to set value to .env key.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is my first Laravel package inspired (copied and adopted to L10) by package of Liam Hammett 'laravel-env-set-command' which is not maintained anymore.

Installation

You can install the package via composer:

composer require krasomir/laravel-env-set-command

Usage

When running the env:set artisan command, you must provide both a key and value as two arguments.

$ php artisan env:set app_name Example
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'Example'

You can also set values with spaces by wrapping them in quotes.

$ php artisan env:set app_name "Example App"
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to '"Example App"'

The command will also create new environment variables if an existing one does not exist.

$ php artisan env:set editor=vscode
# A new environment variable with key 'EDITOR' has been set to 'vscode'

Instead of two arguments split by a space, you can also mimic the .env file format by supplying KEY=VALUE.

$ php artisan env:set app_name=Example
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'Example'

The command will do its best to stop any invalid inputs.

$ php artisan env:set @pp_n@me Laravel
# Invalid environment key @pp_n@me! Only use letters and underscores

You can specify the external .env file in the third optional argument.

$ php artisan env:set APP_NAME TestApp /var/www/my_own_env.env
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'TestApp'

Or in the second parameter if you use key=value syntax.

$ php artisan env:set APP_NAME=TestApp /var/www/my_own_env.env
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'TestApp'

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP Laravel License
v2.1.0 ^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0|^13.0 MIT
v2.0.0 ^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0|^13.0 MIT
v1.1.0 ^8.1|^8.2 ^10.0|^11.0 MIT
v1.0.0 ^8.1 MIT