title: How to put 'is not null' parameter in Laravel 4 validator for uniqueness
body: <p>For an extended use case for a user signup process, I need to allow emails to be taken which are not confirmed yet. That means the emails that are not yet confirmed are considered open. </p>
  
  <p>In <code>users</code> table I use <code>confirmed_at</code> field to denote if an email is confirmed or not. If the field is <code>null</code> then it's not confirmed. Otherwise there'll be a date. </p>
  
  <p>I am trying out with this:</p>
  
  <pre><code>    $v = Validator::make(Input::all(), array(
          'email'         =&gt; 'required|email|unique:users,email,NULL,confirmed_at',
          'password'      =&gt; 'required|confirmed|min:6|max:32',
      )); 
  </code></pre>
  
  <p>This results in the following query:</p>
  
  <pre><code>select count(*) as aggregate from `users` where `email` = 'email@gmail.com'
  </code></pre>
  
  <p>Surprisingly it's not even taking the <code>confirmed_at</code> field in.</p>
  
  <p>Although the <a href="http://laravel.com/docs/validation" rel="nofollow">doc</a> doesn't say about a predefined id field as second parameter, I tried my luck with the following:</p>
  
  <pre><code>$v = Validator::make(Input::all(), array(
              'email' =&gt; 'required|email|unique:users,email,0,id,confirmed_at,NULL',
              'password' =&gt; 'required|confirmed|min:6|max:32',
          ));
  </code></pre>
  
  <p>Now it includes the other parameters in the query and results into:</p>
  
  <pre><code>select count(*) as aggregate from `users` where `email` = 'email@gmail.com' and `id` &lt;&gt; '0' and `confirmed_at` is null 
  </code></pre>
  
  <p>But it employs not equal for the first id field but equal for the confirmed_at field. </p>
  
  <p>So, my first question is, how can I get <code>confirmed_at is not null</code> in to the query? </p>
  
  <p>And secondly, how possibly I could get rid of <code>id &lt;&gt; 0</code> which I had to add although I don't need it?</p>