src/Column.php
public function getSortURL($direction = false)
    {
        if (!$direction) {
            // No direction indicated, determine automatically from defaults.
            $direction = $this->getDirection();

            if ($this->isSorted()) {
                // If we are already sorting by this column, swap the direction
                $direction = $direction == 'asc' ? 'desc' : 'asc';
            }
        }

        // Generate and return a URL which may be used to sort this column
        return $this->generateUrl(array_filter([
            config('gbrock-tables.key_field')     => $this->getField(),
            config('gbrock-tables.key_direction') => $direction,
        ]));
    }
public function getSortURL($direction = false)
    {
        if (!$direction) {
            // No direction indicated, determine automatically from defaults.
            $direction = $this->getDirection();

            if ($this->isSorted()) {
                // If we are already sorting by this column, swap the direction
                $direction = $direction == 'asc' ? 'desc' : 'asc';
            }
        }

        // Generate and return a URL which may be used to sort this column
        return $this->generateUrl(array_filter([
            config('gbrock-tables.key_field')     => $this->getField(),
            config('gbrock-tables.key_direction') => $direction,
        ]));
    }
public function getSortURL ( $ direction = false ) { if ( ! $ direction ) { // No direction indicated, determine automatically from defaults. $ direction = $ this -> getDirection ( ) ; if ( $ this -> isSorted ( ) ) { // If we are already sorting by this column, swap the direction $ direction = $ direction == 'asc' ? 'desc' : 'asc' ; } } // Generate and return a URL which may be used to sort this column return $ this -> generateUrl ( array_filter ( [ config ( 'gbrock-tables.key_field' ) => $ this -> getField ( ) , config ( 'gbrock-tables.key_direction' ) => $ direction , ] ) ) ; }
Generates a URL to toggle sorting by this column.
Generates a URL to toggle sorting by this column .