laravel check if database connection exists code example Example: check which database connect laravel DB::connection();