欢迎各位兄弟 发布技术文章
这里的技术是共享的
<?php return array( 'default' => 'mysql', 'connections' => array( # Our primary database connection 'mysql' => array( 'driver' => 'mysql', 'host' => 'host1', 'database' => 'database1', 'username' => 'user1', 'password' => 'pass1' 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), # Our secondary database connection 'mysql2' => array( 'driver' => 'mysql', 'host' => 'host2', 'database' => 'database2', 'username' => 'user2', 'password' => 'pass2' 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), ), );
$users = DB::connection('mysql2')->select(...);
<?php class SomeModel extends Eloquent { protected $connection = 'mysql2'; }
大神好啊,我说的是配置哦,如何使用我是知道的,就是怎么配置多数据库的,我看文档没有介绍啊。