public function sortBy(string $field, string $direction = 'asc'): self
    {
        $this->sortBy = [$field, $direction];

        return $this;
    }
public function sortBy(string $field, string $direction = 'asc'): self
    {
        $this->sortBy = [$field, $direction];

        return $this;
    }
public function sortBy ( string $ field , string $ direction = 'asc' ) : self { $ this -> sortBy = [ $ field , $ direction ] ; return $ this ; }
Sorts by the given value.

@param string $field
@param string $direction

@return self
Sorts by the given value .