title: How to customize Laravel's Database\Query\Builder (make better subquery)
body: <p>I'm working on Laravel 4. 
  As I knew, I can do subquery:</p>
  
  <pre><code>Project::whereIn('project_id', function($q) {
      $q-&gt;select('project_id')
          -&gt;from('company')
          -&gt;whereNull('deleted_at');
  });
  </code></pre>
  
  <p>I found complications, that I can't use scope in subquery and disable soft_delete make me change source code so much. </p>
  
  <p>I wish it was:</p>
  
  <pre><code>Project::whereIn('project_id', function(&amp;$q) {
      $q = Company::select('project_id')-&gt;getQuery();
  });
  </code></pre>
  
  <p>Now, I can add scope, disable soft_delete easily.</p>
  
  <p>I tried, and found a solution, that I must change Laravel's Database\Query\Builder code, function whereInSub, line 786.</p>
  
  <pre><code>call_user_func($callback, $query = $this-&gt;newQuery());
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>$query = $this-&gt;newQuery();
  call_user_func_array($callback, array(&amp;$query));
  </code></pre>
  
  <p>It's harmful to modify Laravel framework's vendor. So I want to ask how to do it safely.</p>
  
  <p>Sorry because my bad English.</p>
  
  <p>Thank you for reading.</p>