title: Necessity to verify if input is not empty string in laravel?
body: <p>Is it necessary to verify if input has type <code>string</code> and it is not empty in Laravel's validator?</p>
  
  <p>Example:</p>
  
  <pre><code>$v = Validator::make(['myinput' =&gt; $request-&gt;input('myinput')], ['myinput' =&gt; 'integer|min:1']);
  if (!$v-&gt;fails()) {
      $someModel-&gt;integer_field = $request-&gt;input('myinput');
  }
  </code></pre>
  
  <p>Field is not required, and if user supplies this POST request</p>
  
  <pre><code>'field' =&gt; ''
  </code></pre>
  
  <p>Then Mysql complains about empty string that can not be assigned to integer field.</p>
  
  <p>Also if I provide, for example, empty array as input</p>
  
  <pre><code>'field' =&gt; []
  </code></pre>
  
  <p>Then it fails too.</p>
  
  <p>So my question is: how to write robust validators for NOT required fields (e.g., if field is present, then it must be:</p>
  
  <pre><code>1. For integers: 1,2,3,4,... (+ null value if column is nullable),
  
  so any other supplied value will not pass
  
  (like boolean true which can be converted to 1 automatically but should not)
  
  )
  
  2. For string: '', 'example', ... (+ null value if column is nullable)
  </code></pre>
  
  <p>Here is example <a href="https://github.com/laravel/framework/issues/10747" rel="nofollow noreferrer">https://github.com/laravel/framework/issues/10747</a></p>
  
  <p>But <code>sometimes|required|string</code> still passes for empty array...</p>