title: Eloquent query builder get only items which have child items
body: <p>So I am trying to get a list of all active clients that have active jobs but I'm at a loss of how to accomplish this. So here is what I have...</p>
  <pre><code>$query = Client::select( 'clients.*' )-&gt;where( 'is_enabled', 1 )-&gt;activeJobs();
  </code></pre>
  <p>Which throws an error</p>
  <blockquote>
  <p>Call to undefined method Illuminate\Database\Eloquent\Builder::activeJobs()
  in my client model i have the activeJobs() function as follows:</p>
  </blockquote>
  <pre><code>    public function activeJobs()
      {
          return $this-&gt;hasMany( Job::class )-&gt;where( 'is_active', 1 );
      }
  </code></pre>
  <p>Just to explain what I am after with my query in words, I'm trying to get a collection of all active client items (determined by is_enabled = 1) which have 1 or more active jobs (determined by is_active = 1)</p>
  <p>thanks</p>