laravel define which database to use code example
Example 1: DB: in eloquent using sql
$results = DB::select('select * from users where id = :id', ['id' => 1]);
Example 2: laravel transaction query not working when multiple db connection
Start the transaction on the same connection your query will run on.