/** * Add the port to the domain if necessary. * * @param string $domain * @return string */ protected function addPortToDomain($domain) { if (in_array($this->request->getPort(), array('80', '443'))) { return $domain; } return $domain . ':' . $this->request->getPort(); }
/** * Add the port to the domain if necessary. * * @param string $domain * @return string */ protected function addPortToDomain($domain) { $secure = $this->request->isSecure(); $port = $this->request->getPort(); if ($secure && $port === 443 || !$secure && $port === 80) { return $domain; } return $domain . ':' . $port; }
/** * Returns the port on which the request is made. * * This method can read the client port from the "X-Forwarded-Port" header * when trusted proxies were set via "setTrustedProxies()". * * The "X-Forwarded-Port" header must contain the client port. * * If your reverse proxy uses a different header name than "X-Forwarded-Port", * configure it via "setTrustedHeaderName()" with the "client-port" key. * * @return string * @static */ public static function getPort() { //Method inherited from \Symfony\Component\HttpFoundation\Request return \Illuminate\Http\Request::getPort(); }