Laravel 4 带查询参数的Laravel SSL direct?

Laravel 4 带查询参数的Laravel SSL direct?,laravel-4,Laravel 4,我目前使用: Route::filter('no.ssl', function() { if( Request::secure()) { return Redirect::to(Request::path(), 302, array(), false); } }); 这一部分带来了问题: Request::path() 如果用户正在访问的URL是: example.com/bla?p=1 然后它将重定向到: example.com/bla 如何包含

我目前使用:

Route::filter('no.ssl', function()
{
    if( Request::secure())
    {
        return Redirect::to(Request::path(), 302, array(), false);
    }
});
这一部分带来了问题:

Request::path()
如果用户正在访问的URL是:

example.com/bla?p=1
然后它将重定向到:

example.com/bla
如何包含查询参数


我看了一下,没有明显的方法包含查询参数。

更新的API文档位于此处:

如果您查找Request类,您将找到一个fullUrl方法,该方法可以执行您想要的操作

编辑:以上是不正确的!这应该有效,但更为冗长。我会将它添加为某个帮助器方法/函数

if (null !== $qs = $request->getQueryString()) {
    $qs = '?'.$qs;
}
return $request->getBaseUrl().$request->getPathInfo().$qs;

这解决了我的问题:

Route::filter('force.ssl', function()
{
    if( ! Request::secure())
    {
        return 
            Redirect::secure(
                Request::path().(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING'])
            );
    }
});

Route::filter('no.ssl', function()
{
    if( Request::secure())
    {
        return Redirect::to(
            Request::path().(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING']), 302, array(), false
        );

    }
});

完整URL返回整个URL,包括域名和HTTP/HTTPS,因此在这种情况下它不太起作用。我真傻!编辑。