title: laravel eloquent - Use without on nested eager loaded relations
body: <p>I'm currently working on laravel framework and I'm stuck with some relations and eager loading issues.</p>
  <h2>Situation</h2>
  <p>I have three models A, B and C</p>
  <p>I have two relations</p>
  <ul>
  <li>A has many B</li>
  <li>B has many C</li>
  </ul>
  <p>By default (using the $with attribute in Model) :</p>
  <ul>
  <li>A doesn't include B</li>
  <li>B include C</li>
  </ul>
  <p>So most of the time I'm using A without B and B with C</p>
  <p>And here is how I've set up the relationship methods &amp; eager loading</p>
  <pre class="lang-php prettyprint-override"><code>class A extends Model {
  ...
  
    protected $with = [];
  
    public function bs() {
        return $this-&gt;hasMany('App\Models\B');
    }
  
  }
  
  class B extends Model {
  ...
  
    protected $with = ['cs'];
  
    public function cs() {
        return $this-&gt;hasMany('App\Models\C');
    }
  
    public function a() {
        return $this-&gt;belongsTo('App\Models\A');
    }
  }
  
  class C extends Model {
  ...
  
    public function b() {
        return $this-&gt;belongsTo('App\Models\B');
    }
  }
  </code></pre>
  <h2>Problem</h2>
  <p>For a specific task I'd like to query A with all B and without any C</p>
  <p>When I'am using <code>A::query()-&gt;with('b')</code> C are loaded by default</p>
  <p>So I'am trying to use <code>A::query()-&gt;with('b')-&gt;without('b.c')</code>
  But it keep loading B to C relations.</p>
  <p>Have you any idea on how to achieve this ?</p>
  <p>Thanks for your help !</p>