in3pi2
in3pi2

Reputation: 907

How to configure .env file of Laravel 5.1 on Heroku?

I am new to using heroku with laravel.

I made the deployment successfully, guided by http://goo.gl/cxiljl. But, I don't know how to modify the file .env in heroku, to establish data connection to the database.

Upvotes: 3

Views: 6528

Answers (1)

manix
manix

Reputation: 14747

Let's say that this is your local .env file:

[email protected]
URL=example.com

Heroku has a config:set command to set a pair key-value at config file:

$heroku config:set [email protected]
Adding config vars and restarting myapp... done, v12
EMAIL: [email protected]

To show current config values just type heroku config:

$heroku config
EMAIL: [email protected]

Finally when you are done setting all var, just move them into the .env file one by one:

$heroku config:get EMAIL -s  >> .env

You can read more about Heroku's commands in the following articles:

Upvotes: 6

Related Questions