0
votes

You know how Laravel allows for environment based configurations? Where config files in "app/config/local" override those in "app/config". All my config files in the "local" directory override as expected, except the config file: "database.php"

I want to be able to specify different database connections for local and production environment. But when I do, and run "artisan migrate --env=local" it still attempts to use the configuration in the production folder, not the "local" folder.

1
have you tried artisan migrate --env="local"?David Barker
I believe I mentioned that in the questionNeo Ighodaro
What exactly is the problem? Is the migrate --env=local command trying to migrate the production database? You'll have to share the relevant contents of your database.php files to ensure there are no errors there.Andreas
@CreativityKills No, you tried --env=local. Did you try with it wrapped in double quotes.David Barker

1 Answers

1
votes

This sometimes get a bit confusing on local environements. I normally use the hostname in bootstrap/start.php as opposed to the IP.

For example my Virtual Box Localhost's hostname is "debian"... just type hostname in your terminal to get the hostname.

This should work. However, since you're using environment config folders (which I always do) then I would remove the settings in the app/congig/* as you should never need them since your other servers will have their own settings in app/config/yourenv

Hope this helps