title: Ignoring Unique Validation on Update Fucntion Laravel 5
body: <p>I have this <code>customer</code> model which when you create has a unqiue <code>phone_num</code> . It works fine in create but in my update function, which is a form with auto-populated values based from the <code>id</code>. If the user only updated the <code>address</code> as expected the <code>unique</code> validation will trigger again saying <code>The phone num has already been taken.</code> How can I handle this? I want the user to be able to update it's information ignoring the <code>unique</code> validation if the <code>phone_num</code> is still the same thus allowing the <code>unique</code> validation if the user chooses to change the <code>phone_num</code></p>
  
  <p>My code:</p>
  
  <pre><code>public function update($id)
  {
      $rules = array(
          'title'             =&gt; 'required',
          'firstname'         =&gt; 'required',
          'lastname'          =&gt; 'required',
          'gender'            =&gt; 'required',
          'birthdate'         =&gt; 'required',
          'age_bracket'       =&gt; 'required',
          'addr1'             =&gt; 'required',
          'addr2'             =&gt; 'required',
          'addr3'             =&gt; 'required',
          'addr4'             =&gt; 'required',
          'town'              =&gt; 'required',
          'country'           =&gt; 'required',
          'postcode'          =&gt; 'required',
          'phone_num'         =&gt; 'required|unique:customers',
          'phone_type'        =&gt; 'required',
          'work_status'       =&gt; 'required',
          'home_status'       =&gt; 'required',
          'marital_status'    =&gt; 'required',
  
      );
  
      $validator = Validator::make(Input::all(), $rules);
  
  
      // Check if all fields is filled
      if ($validator-&gt;fails()) 
      {
          return Redirect::to('customer/'.$id.'/edit')-&gt;withErrors($validator);
      }
      else
      {
          $customer = Customer::find($id);
          $customer-&gt;title           = Input::get('title');
          $customer-&gt;gender          = Input::get('gender');
          $customer-&gt;firstname       = Input::get('firstname');
          $customer-&gt;lastname        = Input::get('lastname');
          $customer-&gt;postcode        = Input::get('postcode');
          $customer-&gt;addr1           = Input::get('addr1');
          $customer-&gt;addr2           = Input::get('addr2');
          $customer-&gt;addr3           = Input::get('addr3');
          $customer-&gt;addr4           = Input::get('addr4');
          $customer-&gt;addr4           = Input::get('addr4');
          $customer-&gt;town            = Input::get('town');
          $customer-&gt;country         = Input::get('country');
          $customer-&gt;phone_num       = Input::get('phone_num');
          $customer-&gt;phone_type      = Input::get('phone_type');
          $customer-&gt;birthdate       = Input::get('birthdate');
          $customer-&gt;work_status     = Input::get('work_status');
          $customer-&gt;home_status     = Input::get('home_status');
          $customer-&gt;marital_status  = Input::get('marital_status');
          $customer-&gt;agebracket      = Input::get('age_bracket');
  
          if($customer-&gt;save())
          {
              Session::flash('alert-success', 'Form Submitted Successfully.');
          }
          else
          {
              Session::flash('alert-danger', 'Error on submitting form.');
          }
  
          return Redirect::to('customer/'.$id.'/edit');
  
      }
  }
  </code></pre>