Custom Queries
Any time you write a table name by hand (that is not in the default database), call the table() function to convert it to the correct name:
$table = table('crm.users');
$users = DB::table($table)->get();
The database name (crm here) will be replaced with the actual database name from .env (or .env.testing when running tests).
You can also get the database name manually, if you prefer:
$crm = db_name('crm');
$users = DB::table("$crm.users")->get();
Both table() and db_name() accept an optional connection name as the second parameter, in case you have multiple connections.