title: ERROR : Call to undefined method Illuminate\Database\Query\JoinClause::whereIn()
body: <p>I have a method which returns a list of provinces based on some <code>join</code> and <code>where</code> clauses. The problem I have is That <code>laravel</code> throws an Exception that tells there is an undefined method called <code>whereIn</code>. But there exist <code>whereIn</code> method in <code>Eloquent</code>. How should I use <code>whereIn</code> method on joins?</p>
  
  <pre><code>public static function getProvinces($IDs = array()){
          $query =
              DB::Table('doctors')
              -&gt;join('users',  function($join){
                  $join-&gt;on('users.id', '=', 'doctors.user_id')
                      -&gt;whereIn('users.status_id', array(3,4,7));
  
              })
              -&gt;join('contacts',  function($join){
                  $join-&gt;on('doctors.id', '=', 'contacts.doctor_id')
                      -&gt;where('contacts.type_id', '=', 1);
  
              })
              -&gt;join('provinces', 'contacts.province_id', '=', 'provinces.id')
              -&gt;select('contacts.province_id as id','provinces.name as name',DB::raw("COUNT('contacts.province_id') as count"))
              -&gt;groupBy('contacts.province_id');
          if(!empty($IDs))
              $query-&gt;whereIn('doctors.id', $IDs);
          return $query-&gt;get();
  
      }
  </code></pre>
  
  <p>Thanks for your help.</p>