I want to combine multiple databases in my system. Most of the time the database is MySQL; but it may differ in future i.e. Admin can generate such a reports which is use source of heterogeneous database system.
So my question is does Laravel provide any Facade to deal with such situations? Or any other framework have more suitable capabilities for problem is?
.env>= 5.0 (tested on 5.5)
To specify which connection to use, simply run the
$connectionvariable in your model
You can also define the connection at runtime via the
setConnectionmethod or the
From Laravel Docs
Using Multiple Database Connections
When using multiple connections, you may access each
connectionvia the connection method on the
namepassed to the
connectionmethod should correspond to one of the connections listed in your
You may also access the raw, underlying PDO instance using the getPdo method on a connection instance: