title: Laravel catch Eloquent "Unique" field error
body: <p>I am trying to identify when inserting a record using eloquent in Laravel when it throws an exception because of a unique field error.</p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>try {
  
      $result = Emailreminder::create(array(
                         'user_id' =&gt; Auth::user()-&gt;id,
                         'email' =&gt; $newEmail,
                         'token' =&gt; $token,
                ));
  
  } catch (Illuminate\Database\QueryException $e) {
      return $e;
  }
  </code></pre>
  
  <p>It throws an exception OK I just don't know what to do to identify it as a column duplicate error?</p>
  
  <p>Thanks,</p>
  
  <p>Gavin.</p>