Ejemplo n.º 1
0
 /**
  * Get all metrics.
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function getMetrics()
 {
     $metrics = Metric::query();
     if ($sortBy = Binput::get('sort')) {
         $direction = Binput::has('order') && Binput::get('order') == 'desc';
         $metrics->sort($sortBy, $direction);
     }
     $metrics = $metrics->paginate(Binput::get('per_page', 20));
     return $this->paginator($metrics, Request::instance());
 }