1try {
2 $results = \DB::connection("example")
3 ->select(\DB::raw("SELECT * FROM unknown_table"))
4 ->first();
5 // Closures include ->first(), ->get(), ->pluck(), etc.
6} catch(\Illuminate\Database\QueryException $ex){
7 dd($ex->getMessage());
8 // Note any method of class PDOException can be called on $ex.
9}
10