Search code examples
phplaravelproduction-environmentproductionlaravel-5.3

Laravel 5.3. How to configure a production environment?


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!


Solution

  • 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.