title: Laravel 5.4 subquery in where condition?
body: <p>I want to write sub query inside where in condition and in subquery were condition, checking with parent query field.</p>
  
  <p>as follows,</p>
  
  <pre><code>$query = DB::table('users');
  $query-&gt;whereNotIn('users.id', function($query) use ($request) {
              $query-&gt;select('award_user.user_id')
                      -&gt;from('award_user')
                      -&gt;where('award_user.user_id', 'users.id')
                      -&gt;where('award_user.award_id', $request-&gt;award_id);
          });
  </code></pre>
  
  <p>Query is working fine, but </p>
  
  <pre><code> -&gt;where('award_user.user_id', 'users.id')
  </code></pre>
  
  <p>This line, users.id is not taking from parent query. If I enter manually number, then it is working correctly. </p>
  
  <p>What is wrong with my query.. can you please suggest. </p>