• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Set a .env file variable from the command line.

Laravel env:set Command

Latest Version on Packagist Total Downloads License CI Status

Set a .env file variable from the command line.

Example command output

Installation

You can install the package with Composer using the following command:

composer require imliam/laravel-env-set-command:^1.0

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'

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

More Repositories

1

awesome-livewire

🚀 A curated list of awesome resources related to Livewire. https://github.com/livewire/livewire
647
star
2

vscode-inline-parameters

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.
TypeScript
197
star
3

laravel-blade-helper

An easier way to define custom Blade directives.
PHP
178
star
4

php-unique-gmail-address

A package to ensure that a Gmail address is unique
PHP
68
star
5

Lua-Collections

A robust Lua collection class based on Laravel collections.
Lua
50
star
6

laravel-throttle-simultaneous-requests

Throttle the current user's requests based on how many requests are currently being executed.
PHP
46
star
7

tweet-markdown

Effortlessly turn a Tweet into beautiful markdown
PHP
10
star
8

shareable-link

Conveniently generate shareable URLs for various social media websites.
PHP
9
star
9

liamhammett.com-2017

PHP
6
star
10

php-name-of-person

Present names for English-language applications.
PHP
6
star
11

Transformice-Utility

The source code for the Transformice module #utility
Lua
5
star
12

tailwindcss-open-variant

Open variant for Tailwind CSS
JavaScript
5
star
13

php-catch-exit

Gracefully handle an unwanted exit statement.
PHP
4
star
14

laravel-macros

A collection of miscellaneous methods to extend some of Laravel's core classes through the use of macros and mixins
PHP
3
star
15

autoexec.cfg

My personal settings and configuration for playing CS:GO
AutoHotkey
2
star
16

php-indefinite-article

Determine the indefinite article of an English term
PHP
2
star
17

oauth2-transferwise

TransferWise OAuth 2.0 Client Provider for The PHP League OAuth2-Client
PHP
2
star
18

sass-utility-classes

CSS utility classes.
CSS
1
star
19

php-nhs-number

Utility class to validate, format and generate NHS numbers.
PHP
1
star
20

tfm.pics

PHP
1
star
21

php-modifiers

Adds the ability to apply a range of optional modifiers `! @ ~ + -` when calling your class methods to augment them with a unique syntax.
PHP
1
star
22

transformice-records

#records module for the game Transformice
Lua
1
star