Пример #1
0
 /**
  * Execute current query and return list of models.
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function get()
 {
     $models = $this->runner->getCachedModels($this->query);
     if (null === $models) {
         $models = $this->runner->models($this->query);
         $this->runner->setCachedModels($this->query, $models);
         $this->runner->setCachedTotal($this->query, $models->count());
     }
     if ($this->limit) {
         $models = $models->slice($this->offset, $this->limit);
     }
     return Collection::make($models->reload()->all());
 }