db class in laravel code example
Example 1: DB: in eloquent using sql
$results = DB::select('select * from users where id = :id', ['id' => 1]);
Example 2: db name laravel
DB::connection()->getDatabaseName() //laravel
$results = DB::select('select * from users where id = :id', ['id' => 1]);
DB::connection()->getDatabaseName() //laravel