本文整理汇总了PHP中Illuminate\Routing\Redirector::secure方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirector::secure方法的具体用法?PHP Redirector::secure怎么用?PHP Redirector::secure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Redirector
的用法示例。
在下文中一共展示了Redirector::secure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forceSSL
/**
* 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
}
示例2: secure
/**
* 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);
}