Home

Awesome

Laravel 5 env

An artisan command for managing multiple .env of your Laravel 5 app.

Installation

  1. Copy EnvCommand.php to app/Console/Commands/ of your Laravel 5 app.
  2. Register the command in app/Console/Kernel.php (or copy the one from this repo)

Usage

Save the current .env into .$APP_ENV.env.

$ php artisan env
Current application environment: local
$ php artisan env:switch --save
Environmental config file .local.env saved

Switch to another environment, given .$TARGET_ENV.env exists.

$ php artisan env
Current application environment: test
$ php artisan env:switch local
Successfully switched from test to local.
$ php artisan env
Current application environment: local

Thank you