title: Input array validation message error Laravel 5.5
body: <p>I'm trying to show a custom validation message with array inputs when one of them doesn't pass the validation succesfully since the error that Laravel shows by default is something like this:</p>
  
  <blockquote>
    <p>The format of link.1 is invalid.</p>
  </blockquote>
  
  <p>And I want to show something like this:</p>
  
  <blockquote>
    <p>The format of 'value' is invalid.</p>
  </blockquote>
  
  <p>I read that there's this method called <code>messages()</code> which I can override in the Request file:</p>
  
  <p><code>BannerRequest.php</code></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests\Admin;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class BannerRequest 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 [
              "imagenes.*"        =&gt;      "nullable|mimes:jpeg,png,jpg|max:5120",
              "links.*"           =&gt;      "nullable|string|max:191|url",
              "idiomas.*"         =&gt;      "required|string|max:191",
          ];
      }
  
      /**
       * Get the error messages for the defined validation rules.
       *
       * @return array
       */
  
      public function messages()
      {
          $messages = array();
          foreach($this-&gt;imagenes as $key =&gt; $valor) {
              $messages[] = array('imagenes.'.$key.'.mimes:jpeg,png,jpg' =&gt; "La imagen ".$valor." no contiene un formato válido");
              $messages[] = array('imagenes.'.$key.'.max:5120' =&gt; "La imagen ".$valor." no contiene un formato válido");
  
          }
  
          foreach($this-&gt;links as $key =&gt; $valor) {
              $messages[] = array('links.'.$key.'.url' =&gt; "El link ".$valor." no es una URL válida");
  
          }
  
          return $messages;
      }
  }
  </code></pre>
  
  <p>According to documentation:</p>
  
  <blockquote>
    <p>This method should return an array of attribute / rule pairs and their
    corresponding error messages</p>
  </blockquote>
  
  <p>So, since I'm handling array of inputs I thought I should iterate over them in order to get their key to get something like this: <code>link.0.validation_rule</code> then <code>link.1.validation_rule</code> and so on...</p>
  
  <p>But if I do this, when displaying the errors, I get the following error on my view: </p>
  
  <p><code>Array to string conversion</code></p>
  
  <p>The error is thrown on <code>vendor/laravel/framework/src/Illuminate/Support/MessageBag.php</code> at <code>line 247</code>.</p>
  
  <p>What am I doing wrong?, since Laravel doesn't mention a lot for validating input arrays.</p>