title: Eloquent with nested whereHas
body: <p>Currently I have this <strong>whereHas</strong> in a collection of my model:</p>
  
  <pre><code>$query = self::whereHas('club', function($q) use ($search)
  {
      $q-&gt;whereHas('owner', function($q) use ($search)
      {
          $q-&gt;where('name', 'LIKE', '%'. $search .'%');
      });
  
  });
  </code></pre>
  
  <p>I was under the impression the code above could be as such:</p>
  
  <pre><code>$query = self::whereHas('club.owner', function($q) use ($search)
  {
      $q-&gt;where('name', 'LIKE', '%'. $search .'%');    
  });
  </code></pre>
  
  <p>I'm aware this is already a lot of power, but even then, if I have a nested relationship 5 levels deep, things will get ugly.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>As stated in the comments, I ended up not making my question clear, I apologize.</p>
  
  <p>I will try to use a simple example, consider <code>$owner-&gt;club-&gt;membership-&gt;product-&gt;package</code>, now from owners I want to search a certain package, it would be something like this:</p>
  
  <pre><code>$query = self::whereHas('club', function($q) use ($search)
  {
      $q-&gt;whereHas('membership', function($q) use ($search)
      {
          $q-&gt;whereHas('product', function($q) use ($search)
          {
              $q-&gt;whereHas('package', function($q) use ($search)
              {
                  $q-&gt;where('alias', 'LIKE', '%'. $search .'%');
              });//package
          });//product
      });//membership
  });//club
  </code></pre>
  
  <p>Is this correct? Is there a shortcut?</p>