Support the ongoing development of Laravel.io →
Database Packages
Last updated 2 years ago.
0

You can use as many databases as you want in a single migration. In your database config file you can specify any number of connections you want. If you are using MySQL, the default config is at the key "mysql" but you can make "mysql2" or "foobar" or whatever you want. Then in your migration you can tell the Schema facade what connection to use.

Schema::connection('mysql2')->create('some_table', function($table)
{
    $table->increments('id'):
});

More information here: http://fideloper.com/laravel-multiple-database-connections

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

divdax divdax Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.