title: Laravel: Redirecting to a Secure Route with Query String Parameters
body: <p>Using Laravel 4, you can generate a URL to a named route with the following code</p>
  
  <pre><code>$url = route('route-name');
  $url = app('url')-&gt;route('route-name');    
  $url = URL::to('route-name');
  </code></pre>
  
  <p>Is it possible to generate a <strong>secure</strong> URL (https) to a named route?</p>
  
  <p>I know you can "force" a route to be secure when you set it up</p>
  
  <pre><code>Route::get('route-name', array('https', function()
  {
      return 'Must be over HTTPS';
  }));
  </code></pre>
  
  <p>However, "force" (seems to?) mean making the route invisible to <code>http</code> based browsing.  The routing methods/functions don't pick up on this, and still generate <code>http</code> URLs.    </p>
  
  <p>To clarify, I've setup a route like this</p>
  
  <pre><code>Route::get('/stack-overflow', array('as'=&gt;'route-name', function(){
  
  }));
  </code></pre>
  
  <p>That's a route with a path of <code>stack-overflow</code> and a name of <code>route-name</code>.  I can generate a plaintext <code>http</code> link using the name (<code>route-name</code>).  I want to generate a secure <code>https</code> link using the <strong>route name</strong>, not the path.  I also want the generated URL to contain query string parameters</p>
  
  <pre><code>https://example.com/stack-overflow?foo=bar
  </code></pre>