secure() public method

Create a new redirect response to the given HTTPS path.
public secure ( string $path, integer $status = 302, array $headers = [] ) : Illuminate\Http\RedirectResponse
$path string
$status integer
$headers array
return Illuminate\Http\RedirectResponse
Ejemplo n.º 1
0
 /**
  * Force to use https:// requests
  *
  * @return null|RedirectResponse Redirects to the https:// protocol if the current request is insecure
  */
 public function forceSSL()
 {
     if (!$this->request->secure()) {
         return $this->redirect->secure($this->request->getRequestUri());
     }
     return null;
     // The request is already secure
 }
Ejemplo n.º 2
0
 /**
  * Create a new redirect response to the given HTTPS path.
  *
  * @param string $path
  * @param int $status
  * @param array $headers
  * @return \Illuminate\Http\RedirectResponse 
  * @static 
  */
 public static function secure($path, $status = 302, $headers = array())
 {
     return \Illuminate\Routing\Redirector::secure($path, $status, $headers);
 }