PHPackages                             krasomir/laravel-env-set-command - 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. krasomir/laravel-env-set-command

ActiveLibrary

krasomir/laravel-env-set-command
================================

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

v1.1.0(2y ago)01.9k↓38.1%[2 PRs](https://github.com/Krasomir/laravel-env-set-command/pulls)MITPHPPHP ^8.1|^8.2CI passing

Since Nov 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Krasomir/laravel-env-set-command)[ Packagist](https://packagist.org/packages/krasomir/laravel-env-set-command)[ Docs](https://github.com/krasomir/laravel-env-set-command)[ RSS](/packages/krasomir-laravel-env-set-command/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (5)Used By (0)

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

[](#this-package-create-command-to-set-value-to-env-key)

[![Latest Version on Packagist](https://camo.githubusercontent.com/150b4386a981a3d9215e32374201a19d6b06e2bf9a17735bedb4695a24b34215/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7261736f6d69722f6c61726176656c2d656e762d7365742d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/krasomir/laravel-env-set-command)[![GitHub Tests Action Status](https://camo.githubusercontent.com/16d76feabf65befcb013146ca17560ffa8dd9d680fe1d67bfc9ffb657dce53fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b7261736f6d69722f6c61726176656c2d656e762d7365742d636f6d6d616e642f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/krasomir/laravel-env-set-command/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a2e530120998e8f562dd945cef00cdd224236e6aaa8d619f57a6a6469f9421fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b7261736f6d69722f6c61726176656c2d656e762d7365742d636f6d6d616e642f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/krasomir/laravel-env-set-command/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3dba19d7f4d83230359fbb2cb2efb7e66b96795769c262c25f1d01a108f679e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b7261736f6d69722f6c61726176656c2d656e762d7365742d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/krasomir/laravel-env-set-command)

This is my first Laravel package inspired (copied and adopted to L10) by package of Liam Hammett ['laravel-env-set-command'](https://github.com/imliam/laravel-env-set-command) which is not maintained anymore.

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

[](#installation)

You can install the package via composer:

```
composer require krasomir/laravel-env-set-command
```

Usage
-----

[](#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
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Krasomir](https://github.com/Krasomir)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance59

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52% 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 ~76 days

Total

3

Last Release

777d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.1.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d3a4516848f3b88ebda9609465c3bb9d9de5947e3e28286769255ebbb0f9fdb?d=identicon)[kmioc](/maintainers/kmioc)

---

Top Contributors

[![Krasomir](https://avatars.githubusercontent.com/u/6242294?v=4)](https://github.com/Krasomir "Krasomir (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravellaravel-env-set-commandKrasomir

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/krasomir-laravel-env-set-command/health.svg)

```
[![Health](https://phpackages.com/badges/krasomir-laravel-env-set-command/health.svg)](https://phpackages.com/packages/krasomir-laravel-env-set-command)
```

###  Alternatives

[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)[mozex/laravel-scout-bulk-actions

A Laravel Scout extension for bulk importing and flushing of all models.

1033.4k](/packages/mozex-laravel-scout-bulk-actions)

PHPackages © 2026

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