title: Laravel Eager Loading not working on server (different query log)
body: <p>This code works on my computer, but when I tested it on the server it always returns an empty array.</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>$agendaTahunIni = AgendaPromosi::detail()-&gt;year($year)-&gt;get()-&gt;toArray();
  </code></pre>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>public function scopeYear($query,$year){
      $year= (int) $year;
      return $query-&gt;whereYear('tahun_angkatan',$year);
  }
  
  public function scopeDetail($query){
      return $this-&gt;with([
          'MetodeAgendaPromosi',
          'SasaranPromosiProvinsi',
          'SasaranPromosiSekolah'
      ]);
  }
  </code></pre>
  
  <hr>
  
  <p>Strangely, <code>DB::getQueryLog()</code> returns different result. </p>
  
  <p><strong>local</strong></p>
  
  <p><a href="https://i.stack.imgur.com/3ZNtA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ZNtA.png" alt="local"></a> </p>
  
  <p><strong>server</strong></p>
  
  <p><a href="https://i.stack.imgur.com/R4H5k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R4H5k.png" alt="server"></a></p>
  
  <p>Thanks for your help.</p>