title: Moving from HTTP to HTTPS on Laravel behind CloudFlare
body: <p>I have a application made on laravel 5.2.
  It was running fine on HTTP.</p>
  
  <p>I used <code>asset</code> function to generate full url instead of using relative one's like</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="{{ asset('/css/bootstrap.min.css') }}"&gt;
  </code></pre>
  
  <p>According to laravel documentation <a href="https://laravel.com/docs/5.2/helpers#method-asset">here</a>, the <code>asset</code> method automatically detects the request protocol and generates URL accordingly.</p>
  
  <p>Now the application is not running on HTTPS,
  I can use <code>secure_asset</code> for HTTPS URLs, but then it will stop running on HTTP and <code>localhost</code>.</p>
  
  <p>I know there is something I'm missing and it can't be so hard to just migrate from HTTP to HTTPS using <code>laravel</code></p>
  
  <p>PS - <code>Cloudflare</code> is being used for serving <code>HTTPS</code> requests.</p>