title: Laravel5.5 Eloquent Relationships with() no effect
body: <p>I have 3 model, and I already set Relation.</p>
  
  <blockquote>
    <p>Model A:</p>
  </blockquote>
  
  <pre><code>namespace App\Model;
  use Illuminate\Database\Eloquent\Model;
  
  class ComponentA extends Model
  {
      protected $table = 'ComponentA';
      protected $primaryKey = 'ComponentAId';
  
      public function ComponentB() {
          return $this-&gt;hasOne(
              'App\Model\ComponentB', 'ComponentBId', 'ComponentBId'
          );
  }
  </code></pre>
  
  <blockquote>
    <p>Model B:</p>
  </blockquote>
  
  <pre><code>namespace App\Model;
  use Illuminate\Database\Eloquent\Model;
  
  class ComponentB extends Model
  {
      protected $table = 'ComponentB';
      protected $primaryKey = 'ComponentBId';
  
      public function ComponentC() {
          return $this-&gt;hasOne(
              'App\Model\ComponentC', 'ComponentCId', 'ComponentCId'
          )-&gt;withDefault();
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Model C:</p>
  </blockquote>
  
  <pre><code>namespace App\Model;
  use Illuminate\Database\Eloquent\Model;
  
  class ComponentC extends Model
  {
      protected $table = 'ComponentC';
      protected $primaryKey = 'ComponentCId';
  }
  </code></pre>
  
  <p>Now, in the controller, I want to call C from A and <strong>sort by</strong> C column, I use <strong>with()</strong> method.</p>
  
  <blockquote>
    <p>Controller:</p>
  </blockquote>
  
  <pre><code>$this-&gt;ComponentA-&gt;with(['ComponentB.ComponentC' =&gt; function($query) {
      $query-&gt;orderby('ComponentCId','DESC');
  }])-&gt;paginate();
  </code></pre>
  
  <p>That is correct, no any error, but the <strong>result doesn't sort</strong>.</p>
  
  <p>Please help me that where I am wrong ?</p>
  
  <p>Thanks a lot.</p>