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

80 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 best solutions below

0
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