Load a different environment file with Laravel 5 Artisan

In Laravel 5, Artisan tries to load the default .env file. There is a simple way to override this behavior.

Usage

Run the following command in your terminal to load the .env.production file:

$ APP_ENV=production php artisan [your_command]

Ramy Talal

Read more posts by this author.