title: Laravel 5.4: How do I validate an image size?
body: <p>I have a form where a user can submit an image. I don't want to store it on my server in case it's a virus but instead store it to Amazon S3.</p>
  
  <p>My issue is that I need to validate if the image is less than a specific dimension. 
  How can I do that in Laravel 5.4?</p>
  
  <p>My controller</p>
  
  <pre><code> $validator = \Validator::make($request-&gt;all(),[
      "logo"      =&gt; "dimensions:max_width:300,max_height:200",
   ]);
  
   if($validator-&gt;fails()){
      return \Redirect::back()-&gt;withInput()-&gt;withErrors( $validator );
   }
  </code></pre>
  
  <p>The validation fails and redirects back with "The logo has invalid image dimensions." eventhough the image i'm uploading is 100x100.
  What's the correct way to validate or what are alternate solutions without having to save the file?</p>