title: How to set custom attributes for laravel validation instead of numeric keys?
body: <p><strong>How to send the values for laravel validation ?</strong></p>
  
  <pre><code>$data = explode(",", trim(Input::get('Vehicle_Data')));  //exploding data
  $rule  =  array(
  $data[0] =&gt; 'required',
  $data[1] =&gt; 'required',
  $data[2] =&gt; 'required|email|unique:users'
                ) ;
  $validator = Validator::make($data,$rule);
  if ($validator-&gt;fails())
     {
      $messages = $validator-&gt;messages();
      return $messages;
      }
  else
      {
      return 'ok'
      }
  </code></pre>
  
  <p>I just want to check the whether the $data[0] is required and should be unique</p>
  
  <p><strong>It works good when it is</strong> </p>
  
  <pre><code>'email' =&gt; 'required|email|unique:users'
  </code></pre>
  
  <p><strong>But not working when it is</strong> </p>
  
  <pre><code>$data[2] =&gt; 'required|email|unique:users'
  </code></pre>
  
  <p>But i don't want to declare $data[2] into another variable and do it how can i do this without assigning data[2] to another variable</p>
  
  <p><strong>When ever i validate it is returning</strong> </p>
  
  <pre><code>Object {32: Array[1], 43: Array[1]}
  </code></pre>
  
  <p>in the console</p>