Styphon Styphon - 1 year ago 113
PHP Question

Setting the environment in Laravel 5

I'm trying to change the environment in my app from local to production. I've modified the .env file but whenever I run a query it's not using the config I have in config/database.php, or the database settings in .env, but the default homestead @ localhost. How can I change the environment to production?

Answer Source

As per my comment all I needed to do was restart the server, in my case artisan serve. It only loads the environment when starting, so any changes don't take effect whilst it's running.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download