Laravel 5.3. How to configure a production environment?

Maximiliano Sosa picture Maximiliano Sosa · Sep 25, 2016 · Viewed 26.4k times · Source

I got started with Laravel 5.3 and I got my development environment working on local, but now I need to upload the app to production server. I cant found nothing about configuring two environments on same app.

I use Apache web server on both (local and production).

Any guide/doc is well received!

Answer

Root - picture Root - · Sep 25, 2016

The docs (as pointed by Marcin) suggest to use the .env file to configure your environment. Different environments = different .env files. Thus, on local machine you'd have an .env file with your local enviroment configuration, and on production you'd have a different .env file, and a diffrent one for staging, and so on... APP_ENV=production

Which can be brought forth with App::environment()

Remember to exclude the .env from versioning, cheers.