original_string: public function sorter()
      {
          if (!$this->sortable) {
              return '';
          }
  
          $icon = 'fa-sort';
          $type = 'desc';
  
          if ($this->isSorted()) {
              $type = $this->sort['type'] == 'desc' ? 'asc' : 'desc';
              $icon .= "-amount-{$this->sort['type']}";
          }
  
          // set sort value
          $sort = ['column' => $this->name, 'type' => $type];
          if (isset($this->cast)) {
              $sort['cast'] = $this->cast;
          }
  
          $query = app('request')->all();
          $query = array_merge($query, [$this->grid->model()->getSortName() => $sort]);
  
          $url = url()->current().'?'.http_build_query($query);
  
          return "<a class=\"fa fa-fw $icon\" href=\"$url\"></a>";
      }
code: public function sorter()
      {
          if (!$this->sortable) {
              return '';
          }
  
          $icon = 'fa-sort';
          $type = 'desc';
  
          if ($this->isSorted()) {
              $type = $this->sort['type'] == 'desc' ? 'asc' : 'desc';
              $icon .= "-amount-{$this->sort['type']}";
          }
  
          // set sort value
          $sort = ['column' => $this->name, 'type' => $type];
          if (isset($this->cast)) {
              $sort['cast'] = $this->cast;
          }
  
          $query = app('request')->all();
          $query = array_merge($query, [$this->grid->model()->getSortName() => $sort]);
  
          $url = url()->current().'?'.http_build_query($query);
  
          return "<a class=\"fa fa-fw $icon\" href=\"$url\"></a>";
      }
code_tokens: public function sorter ( ) { if ( ! $ this -> sortable ) { return '' ; } $ icon = 'fa-sort' ; $ type = 'desc' ; if ( $ this -> isSorted ( ) ) { $ type = $ this -> sort [ 'type' ] == 'desc' ? 'asc' : 'desc' ; $ icon .= "-amount-{$this->sort['type']}" ; } // set sort value $ sort = [ 'column' => $ this -> name , 'type' => $ type ] ; if ( isset ( $ this -> cast ) ) { $ sort [ 'cast' ] = $ this -> cast ; } $ query = app ( 'request' ) -> all ( ) ; $ query = array_merge ( $ query , [ $ this -> grid -> model ( ) -> getSortName ( ) => $ sort ] ) ; $ url = url ( ) -> current ( ) . '?' . http_build_query ( $ query ) ; return "<a class=\"fa fa-fw $icon\" href=\"$url\"></a>" ; }
docstring: Create the column sorter.
  
  @return string
docstring_tokens: Create the column sorter .