Multiple DB Connections in Laravel 5

Few day back while developing an application I come up to a point where I need to connect to the different database dynamically. I google around and I found few good solution in multiple websites; So I thought to stitch them into a single piece.
Before proceeding we first have to edit our database.php
which is located in /config/database.php
for Lavael 4.2 it is in app/config/database.php
.
Now that we have set the DB connections it’s time to use it
Defining in Model
If have Model which uses a different database then we can define it at the model level like this:
In Eloquent Query
In DB Query
Let me know through the comment if I missed out any point. Cheers!
+1
I think this is a real great article. Much thanks again. Fantastic.