is that any way to Laravel migrate with new database connection using my new Config file?

71 views Asked by At

without using my config/database.php in mysql connection.

to use my config/newdatabase.php in newsql connection.

example command such as blow.

php artisan migrate database=newsql

Thanks.

1

There are 1 answers

0
Maarten Veerman On

It would be better to define a new .env file instead of a second config file with database info. Laravel just won't recognize the second config file, it'll be troublesome.

Create a file called .env.newsettings, update your database settings, than run: php artisan migrate --env=newsettings