original_string: public function scopeOrder($query)
      {
          $order = Input::get('order', isset($this->order) ? $this->order : 'id') ?: 'id';
          $direction = Input::get('direction', isset($this->direction) ? $this->direction : 'desc') ?: 'desc';
  
          return $query->orderBy($order, $direction);
      }
code: public function scopeOrder($query)
      {
          $order = Input::get('order', isset($this->order) ? $this->order : 'id') ?: 'id';
          $direction = Input::get('direction', isset($this->direction) ? $this->direction : 'desc') ?: 'desc';
  
          return $query->orderBy($order, $direction);
      }
code_tokens: public function scopeOrder ( $ query ) { $ order = Input :: get ( 'order' , isset ( $ this -> order ) ? $ this -> order : 'id' ) ? : 'id' ; $ direction = Input :: get ( 'direction' , isset ( $ this -> direction ) ? $ this -> direction : 'desc' ) ? : 'desc' ; return $ query -> orderBy ( $ order , $ direction ) ; }
docstring: Scope a query to order by query properties
  
  @param $query
  @return Builder
docstring_tokens: Scope a query to order by query properties