tommyku / laravel5_env

An artisan command for using multiple environment configurations in Laravel 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  • Thanks @leonel for raising the issue, which inspired me to create this command.

About

An artisan command for using multiple environment configurations in Laravel 5


Languages

Language:PHP 100.0%