title: Custom error message in Laravel
body: <p>I am validating an array in Laravel. I get <code>"0.id has already been taken."</code> in default error message. So I added a 2nd parameter in my validator: <code>'unique' =&gt;':attribute has already been taken. Please fix your data in spreadsheet.'</code> and shows <code>"0.id has already been taken. Please fix your data in spreadsheet."</code>. I added the 3rd parameter which is the custom attribute. <code>['*.id' =&gt;'Student ID']</code>. But I want to have a message like this: <code>ID has already been taken. Please fix your data in spreadsheet in line 1.</code></p>
  
  <p>Here's my full validation code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$validate = $request - &gt; validate([
    '*.id' =&gt; 'required|unique:students|numeric',
    '*.rfid_number' =&gt; 'required|unique:students|numeric',
    '*.first_name' =&gt; 'required|alpha|max:100',
    '*.middle_name' =&gt; 'alpha|max:100|nullable',
    '*.last_name' =&gt; 'required|string|max:100',
    '*.name_extension' =&gt; 'alpha|max:10|nullable',
    '*.email' =&gt; 'required|email|unique:students',
    '*.photo' =&gt; 'string|nullable',
    '*.house_number' =&gt; 'required|integer',
    '*.barangay' =&gt; 'required|alpha|max:100',
    '*.city' =&gt; 'required|alpha|max:100',
    '*.province' =&gt; 'required|string|max:100',
    '*.zip_code' =&gt; 'required|integer',
    '*.birth_date' =&gt; 'required|date|max:100',
    '*.birth_place' =&gt; 'string|max:200',
    '*.gender' =&gt; 'required|alpha',
    '*.religion' =&gt; 'alpha|max:100|nullable',
    '*.landline_number' =&gt; 'numeric|max:20|nullable',
    '*.mobile_number' =&gt; 'required',
    '*.father_name' =&gt; 'string|max:200|required',
    '*.father_occupation' =&gt; 'string|max:200|nullable',
    '*.mother_name' =&gt; 'string|max:200|required',
    '*.mother_occupation' =&gt; 'string|max:200|nullable',
    '*.guardian_name' =&gt; 'string|max:200|required',
    '*.guardian_occupation' =&gt; 'string|max:200|nullable',
    '*.guardian_address' =&gt; 'string|max:200|nullable',
    '*.year' =&gt; 'integer|max:10|required',
    '*.section' =&gt; 'alpha|max:200|required'
  ], [
    'unique' =&gt; ':attribute has already been taken. Please fix your data in spreadsheet.'
  ], [ //attributes
    '*.id' =&gt; 'Student ID'
  ]);</code></pre>
  </div>
  </div>
  </p>