PHPackages                             causefx/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. causefx/laravel-env

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

causefx/laravel-env
===================

Laravel env helper commands

01PHP

Since Oct 16Pushed 3y agoCompare

[ Source](https://github.com/causefx/laravel-env)[ Packagist](https://packagist.org/packages/causefx/laravel-env)[ RSS](/packages/causefx-laravel-env/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![laravel-env](https://github.com/msztorc/laravel-env/workflows/tests/badge.svg)](https://github.com/msztorc/laravel-env/actions)[![Build Status](https://camo.githubusercontent.com/0fe67c5dbe0d2471e9c978c3c0a7ddcd745ba6dff7c0554e0f15f2fe2781c827/68747470733a2f2f7472617669732d63692e6f72672f6d737a746f72632f6c61726176656c2d656e762e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/msztorc/laravel-env)[![Quality Score](https://camo.githubusercontent.com/4e17d682b6cf018931ad581cc1815acba6e691235ae9550bafae0c7feb380c12/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d737a746f72632f6c61726176656c2d656e762e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/msztorc/laravel-env)[![Latest Version on Packagist](https://camo.githubusercontent.com/f89654cbbbe935e3eaf21c2bc339011b44eed0e0db7aa555e28a33012436e201/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d737a746f72632f6c61726176656c2d656e762e7376673f7374796c653d666c6174)](https://packagist.org/packages/msztorc/laravel-env)[![Total Downloads](https://camo.githubusercontent.com/69c2f04a1803ece3da2dca67382e266238e040cc73f8d6ff928bd8bee267bcde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d737a746f72632f6c61726176656c2d656e762e7376673f7374796c653d666c6174)](https://packagist.org/packages/msztorc/laravel-env)[![License](https://camo.githubusercontent.com/ae6143df09c2127bb64b761c871edc4a530c94162921b84b2bc7cf168c8ce661/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)

Laravel-Env
===========

[](#laravel-env)

Managing environment variables programmatically and from the command line (by the artisan)

[![](laravel-env.gif)](laravel-env.gif)

- [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require msztorc/laravel-env
```

Usage
-----

[](#usage)

### `env:get` - Getting environment variable value

[](#envget---getting-environment-variable-value)

**CLI by Artisan**

`php artisan env:get VAR_KEY`

Get value only

```
$ php artisan env:get APP_NAME
Laravel
```

Get key-value

```
$ php artisan env:get APP_NAME --key-value
APP_NAME=Laravel
```

Get key-value as JSON output

```
$ php artisan env:get APP_NAME --json
{"APP_NAME":"Laravel"}
```

Print all env variables as JSON output

```
$ php artisan env:get --json
{"APP_NAME":"Laravel","APP_ENV":"local","APP_KEY":"","APP_DEBUG":"true","APP_URL":"http:\/\/localhost","LOG_CHANNEL":"stack","DB_CONNECTION":"mysql","DB_HOST":"127.0.0.1","DB_PORT":"3306","DB_DATABASE":"laravel","DB_USERNAME":"root","DB_PASSWORD":"","BROADCAST_DRIVER":"log","CACHE_DRIVER":"file","QUEUE_CONNECTION":"sync","SESSION_DRIVER":"file","SESSION_LIFETIME":"120","REDIS_HOST":"127.0.0.1","REDIS_PASSWORD":"null","REDIS_PORT":"6379","MAIL_MAILER":"smtp","MAIL_HOST":"smtp.mailtrap.io","MAIL_PORT":"2525","MAIL_USERNAME":"null","MAIL_PASSWORD":"null","MAIL_ENCRYPTION":"null","MAIL_FROM_ADDRESS":"null","MAIL_FROM_NAME":"${APP_NAME}","AWS_ACCESS_KEY_ID":"","AWS_SECRET_ACCESS_KEY":"","AWS_DEFAULT_REGION":"us-east-1","AWS_BUCKET":"","PUSHER_APP_ID":"","PUSHER_APP_KEY":"","PUSHER_APP_SECRET":"","PUSHER_APP_CLUSTER":"mt1","MIX_PUSHER_APP_KEY":"${PUSHER_APP_KEY}","MIX_PUSHER_APP_CLUSTER":"${PUSHER_APP_CLUSTER}"}
```

**Programmatically**

```
