title: compress size of image (Laravel)
body: <p>I have this code to insert a image in db and in the uploads folder. Do you know what is necessary so is possible to compress the size of the uploaded images?</p>
  
  <p>...</p>
  
  <pre><code>if ($request-&gt;image) {
      $featured = $request-&gt;image;
      $featured_new_name = time() . $featured-&gt;getClientOriginalName();
      $featured-&gt;move('uploads/posts', $featured_new_name);
  } else {
      $featured_new_name = null;
  }
  
   $post = Post::create([
            ...
              'image' =&gt; $featured_new_name ? "uploads/posts/{$featured_new_name}" : null,
  ...
  $conf-&gt;save();
  </code></pre>
  
  <p>...</p>