title: Laravel 4: Adding where clause to a join condition
body: <p>It says in the <a href="http://laravel.com/docs/queries#joins">laravel docs</a> that it is possible to add where clause on a join, but whenever I try in my code using the where clause, I get the error: <code>Call to undefined method Illuminate\Database\Query\JoinClause::where()</code>. Anyone knows how to add where clause in a join clause?</p>
  
  <p>Laravel Website Example:</p>
  
  <pre><code>DB::table('users')
  -&gt;join('contacts', function($join)
  {
    $join-&gt;on('users.id', '=', 'contacts.user_id')
    -&gt;where('contacts.user_id', '&gt;', 5);
  })
  -&gt;get();
  </code></pre>
  
  <p>Code I'm trying to implement:</p>
  
  <pre><code>DB::table('users')
  -&gt;join('contacts', function($join)
  {
    $current_date = date('Y-m-d');
    $join-&gt;on('users.id', '=', 'contacts.user_id')
    -&gt;where('contacts.effective_date', '&gt;=', $current_date);
  })
  -&gt;get();
  </code></pre>