Last active
March 30, 2017 05:05
-
-
Save web-hat/3660b0900e4674be3318990884620021 to your computer and use it in GitHub Desktop.
Change Default Database connection Dynamically.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
//... | |
//... | |
'default' => 'mysql_primary', | |
'connections' => [ | |
//.. | |
//Our Default Database Connection | |
'mysql_primary' => [ | |
'driver' => 'mysql', | |
'host' => 'localhost', | |
'database' => 'my_first_db', | |
'username' => 'root', | |
'password' => '', | |
'charset' => 'utf8', | |
'collation' => 'utf8_unicode_ci', | |
'prefix' => '', | |
'strict' => false, | |
], | |
//Our Secondary Database Connection | |
'mysql_second' => [ | |
'driver' => 'mysql', | |
'host' => 'localhost', | |
'database' => 'my_second_db', | |
'username' => 'root', | |
'password' => '', | |
'charset' => 'utf8', | |
'collation' => 'utf8_unicode_ci', | |
'prefix' => '', | |
'strict' => false, | |
], | |
//.. | |
//... | |
], | |
//.. | |
//... | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment