original_string: public function index()
      {
          $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());
      }
code: public function index()
      {
          $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());
      }
code_tokens: public function index ( ) { $ 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 ( ) ) ; }
docstring: Get all metrics.
  
  @return \Illuminate\Database\Eloquent\Collection
docstring_tokens: Get all metrics .