Created
April 5, 2017 03:20
-
-
Save web-hat/a046d15820d903421fc000964d6ed7b4 to your computer and use it in GitHub Desktop.
Multiple DB Connections in Laravel 5
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 | |
//create an instance of your model | |
$objMyModel = new MyModel(); | |
//query for fetching data | |
$data = $objMyModel->setConnection('mysql_second') | |
->select('col_1') | |
->get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment