// Model class Client extends Eloquent { protected $connection = 'masterDb'; } // config/database.php 'masterDb' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'name', 'username' => 'user', 'password' => 'pass', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ),
You can create as many name compounds as you like. Set one of them by default, each model can use any of these connections later.
Andreyco
source share