title: Laravel form validation unique using 2 fields
body: <p>How can I have a unique validation rule on 2 fields?</p>
  
  <p>a. The application should not allow two people to have the same identical first name and last name.</p>
  
  <p>It is allowed that the users fills in only a first name or only a last name. Because the user may have only one of them.</p>
  
  <p>b. But if the user enters only a first name (Glen), no other person in the table should have the same (first name = 'Glen' and last name = null). another 'Glen Smith' ok.</p>
  
  <p>I tried the following rule. It works great when both fields (first and last name) are not null:</p>
  
  <pre><code>'firstName' =&gt; 'unique:people,firstName,NULL,id,lastName,' . $request-&gt;lastName
  </code></pre>
  
  <p>This rule fails on b. when only one field is present.</p>
  
  <p>Any hint?</p>