Laravel Multiple DB Connections in Laravel Using DB query builder


Example

Similar to Schema Builder, define a connection on the Query Builder:

$users = DB::connection('mysql2')->select(...);