request->hostInfo; $protocol = env('PAY_NOTIFY_PROTOCOL', false); if ($protocol === 'http') { $host_info = str_replace('https:', 'http:', $host_info); } if ($protocol === 'https') { $host_info = str_replace('http:', 'https:', $host_info); } return $host_info; } }