title: Laravel how to validate multiple files (images) using FormRequest
body: <p>As part of a form, I want to submit up to five images and validate them in a FormRequest with custom error messages. </p>
  
  <p>The file submit part of the form looks like this:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;div id="dzone" class="form-group dropzone {{ $errors-&gt;has('images') ? ' has-error' : '' }}"&gt;
      &lt;div class="fallback"&gt;
          &lt;label for="images[]"&gt;Select up to five images...&lt;/label&gt;
          &lt;input name="images[]" type="file" multiple/&gt;
      &lt;/div&gt;
      @if ($errors-&gt;has('images'))
          &lt;span class="help-block"&gt;{{ $errors-&gt;first('images') }}&lt;/span&gt;
      @endif
  &lt;/div&gt;
  </code></pre>
  
  <p>My FormRequest looks like this:</p>
  
  <pre><code>namespace App\Http\Requests;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class StoreListingFormRequest extends FormRequest
  {
  /**
   * Determine if the user is authorized to make this request.
   *
   * @return bool
   */
  public function authorize()
  {
      return true;
  }
  
  /**
   * Get the validation rules that apply to the request.
   *
   * @return array
   */
  public function rules()
  {
      return [
          'title' =&gt; 'required|max:255',
          'body' =&gt; 'required|max:2000',
          'price' =&gt; 'required|max:100|regex:/^\d{1,13}(\.\d{1,4})?$/',
          'contact_details' =&gt; 'required',
          "images"    =&gt; "required|array|min:1|max:5",
          'images.*' =&gt; 'required|mimes:jpg,jpeg,png,bmp|max:2000',
          'category_id' =&gt; [
              'required',
              \Illuminate\Validation\Rule::exists('categories', 'id')-&gt;where(function ($query) {
                  $query-&gt;where('usable', true);
              })
          ],
          'area_id' =&gt; [
              'required',
              \Illuminate\Validation\Rule::exists('areas', 'id')-&gt;where(function ($query) {
                  $query-&gt;where('usable', true);
              })
          ]
      ];
  }
  
  public function messages()
  {
      return [
          'contact_details.required' =&gt; 'At least one method of contact is required for your advert.',
          'images.min' =&gt; 'Please upload one or more images',
          'images.max' =&gt; 'A maximum of five images are allowed',
          'images.*.mimes' =&gt; 'Only jpeg,png and bmp images are allowed',
          'images.*.max' =&gt; 'Sorry! Maximum allowed size for an image is 2MB',
      ];
  }
  }
  </code></pre>
  
  <p>There several things not working with the images validation:</p>
  
  <p>First, if I set min:1 on the images array it does not return an error message if I submit no images but if I set it to 2 it returns my custom error message.</p>
  
  <p>I cannot get any error messages to return for images.<em>.mimes' or 'images.</em>.max'</p>
  
  <p>what am I doing wrong here?</p>