PHPackages                             lionix/envclient - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. lionix/envclient

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

lionix/envclient
================

Laravel environment client and console commands.

1.1.3(5y ago)1621.5k1[2 issues](https://github.com/lionix-team/envclient/issues)MITPHPPHP ^7.2.5|^8.0CI failing

Since Jan 31Pushed 5y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (8)Used By (0)

EnvClient for Laravel
=====================

[](#envclient-for-laravel)

Manage and validate environmental variables with artisan console commands, environmental rules and facades

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

[](#installation)

```
composer require lionix/envclient

```

Breaking changes
----------------

[](#breaking-changes)

### From 1.0.0 to 1.1.0

[](#from-100-to-110)

- To construct the `\Lionix\Envclient` use Laravel Service Container instead of plain construct.

Artisan commands
----------------

[](#artisan-commands)

SignatureDescription`env:get {key}`Prints .env variable value`env:set {key} {value}`Sets .env variable if validation rules are passed`env:check`Check all env variables for validness`env:empty`Print empty .env variables`make:envrule {name}`Create a new .env validation rulesBasic usage
-----------

[](#basic-usage)

Set an environment variable using `env:set` artisan command.

```
php artisan env:set EXAMPLE_ENV_VARIABLE 'example value'

```

The command will modify your environment file by replacing or adding the given key to it.

### Validate environment variables

[](#validate-environment-variables)

If you want to apply validation rules to environmental variables before `env:set` command will modify the file you will have to publish command package configuration files.

```
php artisan vendor:publish --provider='Lionix\EnvClient\Providers\EnvClientServiceProvider' --tag='config'

```

The command will create `config/env.php`

```
