title: Laravel 4 Query Cache
body: <p>I'm having trouble getting my queries to cache. Anytime I hit my API I am getting fresh results from the DB instead of the Cached results that im going for. The odd thing is if I look in the file cache I can see the cached results and they are exactly what im expecting, yet when I call the API I get fresh results. Below are some snippets of the relevant files. Where am I going wrong here?</p>
  
  <p>Repository Function my API calls:</p>
  
  <pre><code>public function topMonth()
  {
      $top = $this-&gt;repository-&gt;month()-&gt;top()-&gt;joinUser()-&gt;remember(30)-&gt;get(['things.id', 'things.votes', 'things.title', 'things.description', 'things.tags', 'things.created_at', 'users.id as user_id','users.username','users.picture as user_picture'])-&gt;toArray();
  
      return $top;
  }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>class Thing extends Eloquent
  {
  
  public function scopeTop($query)
  {
      return $query-&gt;orderBy('things.votes', 'desc');
  }
  
  public function scopeYear($query)
  {
      return $query-&gt;whereRaw("things.created_at &gt; STR_TO_DATE('" . Carbon::now()-&gt;subYear() . "', '%Y-%m-%d %H:%i:%s')");
  }
  
  public function scopeMonth($query)
  {
      return $query-&gt;whereRaw("things.created_at &gt; STR_TO_DATE('" . Carbon::now()-&gt;subMonth() . "', '%Y-%m-%d %H:%i:%s')");
  }
  
  public function scopeWeek($query)
  {
      return $query-&gt;whereRaw("things.created_at &gt; STR_TO_DATE('" . Carbon::now()-&gt;subWeek() . "', '%Y-%m-%d %H:%i:%s')");
  }
  
  public function scopeDay($query)
  {
      return $query-&gt;whereRaw("things.created_at &gt; STR_TO_DATE('" . Carbon::now()-&gt;subDay() . "', '%Y-%m-%d %H:%i:%s')");
  }
  
  public function scopeJoinUser($query)
  {
      return $query-&gt;join('users', function($join)
          {
              $join-&gt;on('users.id', '=', 'things.created_by');
          });
  }
  
  }
  </code></pre>