title: Laravel validation unique
body: <p>I have a table with a unique column. 
  My form validation rules look like this:</p>
  
  <pre><code>    return Validator::make($data, [
        'nameEN'   =&gt; 'required|string',
        'nameHE'   =&gt; 'required|string',
        'address'  =&gt; 'required|string|min:10|unique:clients'
      ]);
  </code></pre>
  
  <p>My issue is that when I edit a row, I get a validation error if I haven't changed the address column. </p>
  
  <p>My edit function looks like so:</p>
  
  <pre><code>public function editPost(Request $request,$id){
      $client = new Client();
      $client-&gt;editValidation($request-&gt;all())-&gt;validate();
      $row = $client-&gt;where('id',$id)-&gt;get()-&gt;first();
      $update = array();
      if(!empty($request-&gt;input("nameEN"))    &amp;&amp; $request-&gt;input("nameEN")    != $row-&gt;nameEN) $update["nameEN"] = $request-&gt;input("nameEN");
      if(!empty($request-&gt;input("nameHE"))    &amp;&amp; $request-&gt;input("nameHE")    != $row-&gt;nameHE) $update["nameHE"] = $request-&gt;input("nameHE");
      if(!empty($request-&gt;input("address"))   &amp;&amp; $request-&gt;input("address")   != $row-&gt;address) $update["address"] = $request-&gt;input("address");
  
      if(empty($update)) $message = $this-&gt;message("info", "Notic: Client {$row-&gt;nameEN} was not updated because nothing was changed.");
      else if($client-&gt;where("id",$row-&gt;id)-&gt;update($update)){
          $message = $this-&gt;message("success", "Client {$row-&gt;nameEN} was updated.");
      } else {
          $message = $this-&gt;message("danger", "Error: Client {$row-&gt;nameEN} was not updated.");
      }
      $redirect = redirect("clients");
      if(isset($message)) $redirect-&gt;with("message",$message);
      return $redirect;
  }
  </code></pre>
  
  <p>If I remove the <code>unique</code> from my validation rules I risk the chance of getting a mysql error.</p>
  
  <p>How can this be sorted out?</p>
  
  <p>Thank you in advance.</p>