title: How to serve scaled images in Laravel?
body: <p>I display the images like:</p>
  
  <pre><code> &lt;img class="card-img-top" style="max-height: 121px; 
   border:1px solid #eee;"
   src="{{ $post-&gt;image == null ? url('img/default.png') : url($post-&gt;image)}}
  </code></pre>
  
  <p>But in the pagespeed analysis it appears a recommendation "PageSpeed: Serve scaled images" for some images like:</p>
  
  <p>The following images are resized in HTML or CSS. Serving scaled images could save 353.7KiB (90% reduction).</p>
  
  <p>Do you know how to correct this issue?</p>
  
  <pre><code>https://....ngrok.io/uploads/posts/img1.png is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 173.3KiB (90% reduction).
  https://....ngrok.io/uploads/posts/img2.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 40.2KiB (90% reduction).
  https://....ngrok.io/uploads/posts/img3.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 38.3KiB (90% reduction).
  https://....ngrok.io/uploads/posts/img4.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 31.6KiB (90% reduction).
  https://...ngrok.io/uploads/posts/img5.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 28.9KiB (90% reduction).
  https://....ngrok.io/uploads/posts/img6.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 28.0KiB (90% reduction).
  https://....ngrok.io/uploads/posts/img7.jpg is resized in HTML or CSS from 800x400 to 251x119. Serving a scaled image could save 13.4KiB (90% reduction).
  </code></pre>