title: How to check if the submitted picture is horizontal? Laravel
body: <p>I created a custom validation rule by using the command:
  <code>php artisan make:rule Horizontal</code></p>
  <p>Now, how to check if the submitted picture from my post form is horizontal?
  I tried this:</p>
  <pre><code> public function passes($attribute, $value)
  {
  
      if ($this-&gt;request-&gt;has('picture')) {
          $image = $this-&gt;request-&gt;get('picture');
          if ($image-&gt;width &lt; $image-&gt;height) {
              session()-&gt;flash('error', 'Image must be horizontal!');
              return false;
          }
      }
  }
  
  public function message()
  {
      return 'The validation error message.';
  }
  </code></pre>
  <p>My Post Request:</p>
  <pre><code>public function rules()
  {
      return [
          'title' =&gt; 'required|min:2|max:255',
          'body' =&gt; 'required|min:10',
          'picture' =&gt; [
              'required',
              new Horizontal()
          ]
      ];
  }
  </code></pre>