Request::isSecure PHP Method

isSecure() public static method

This method can read the client protocol from the "X-Forwarded-Proto" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". If your reverse proxy uses a different header name than "X-Forwarded-Proto" ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with the "client-proto" key.
public static isSecure ( ) : boolean
return boolean
        public static function isSecure()
        {
            //Method inherited from \Symfony\Component\HttpFoundation\Request
            return \Illuminate\Http\Request::isSecure();
        }

Usage Example

Example #1
0
 /**
  * @param \Illuminate\Config\Repository $config
  */
 public function __construct(Config $config, Session $session)
 {
     $scheme = \Request::isSecure() ? 'https://' : 'http://';
     $this->u2f = new \u2flib_server\U2F($scheme . \Request::getHttpHost());
     $this->config = $config;
     $this->session = $session;
 }
All Usage Examples Of Request::isSecure