src/QueryBuilder.php
protected function getData()
    {
        if (is_null($this->order[0])) {
            return $this->table->data['data'];
        }

        $items  = $this->table->data['data'];
        $col    = $this->order[0];
        $order  = $this->order[1];

        usort($items, function ($a, $b) use ($col, $order) {
            if (!isset($a[$col]) && !isset($b[$col])) {
                return 0;
            }

            if (is_array($a[$col]) || is_array($b[$col])) {
                return 0;
            }

            if (!isset($a[$col]) || is_array($a[$col])) {
                return $order == 'asc' ? -1 : 1;
            }

            if (!isset($b[$col]) || is_array($b[$col])) {
                return $order == 'asc' ? 1 : -1;
            }

            return $order == 'asc'
                ? strnatcmp((string) $a[$col], (string) $b[$col])
                : strnatcmp((string) $b[$col], (string) $a[$col]);
        });

        return $items;
    }
protected function getData()
    {
        if (is_null($this->order[0])) {
            return $this->table->data['data'];
        }

        $items  = $this->table->data['data'];
        $col    = $this->order[0];
        $order  = $this->order[1];

        usort($items, function ($a, $b) use ($col, $order) {
            if (!isset($a[$col]) && !isset($b[$col])) {
                return 0;
            }

            if (is_array($a[$col]) || is_array($b[$col])) {
                return 0;
            }

            if (!isset($a[$col]) || is_array($a[$col])) {
                return $order == 'asc' ? -1 : 1;
            }

            if (!isset($b[$col]) || is_array($b[$col])) {
                return $order == 'asc' ? 1 : -1;
            }

            return $order == 'asc'
                ? strnatcmp((string) $a[$col], (string) $b[$col])
                : strnatcmp((string) $b[$col], (string) $a[$col]);
        });

        return $items;
    }
protected function getData ( ) { if ( is_null ( $ this -> order [ 0 ] ) ) { return $ this -> table -> data [ 'data' ] ; } $ items = $ this -> table -> data [ 'data' ] ; $ col = $ this -> order [ 0 ] ; $ order = $ this -> order [ 1 ] ; usort ( $ items , function ( $ a , $ b ) use ( $ col , $ order ) { if ( ! isset ( $ a [ $ col ] ) && ! isset ( $ b [ $ col ] ) ) { return 0 ; } if ( is_array ( $ a [ $ col ] ) || is_array ( $ b [ $ col ] ) ) { return 0 ; } if ( ! isset ( $ a [ $ col ] ) || is_array ( $ a [ $ col ] ) ) { return $ order == 'asc' ? - 1 : 1 ; } if ( ! isset ( $ b [ $ col ] ) || is_array ( $ b [ $ col ] ) ) { return $ order == 'asc' ? 1 : - 1 ; } return $ order == 'asc' ? strnatcmp ( ( string ) $ a [ $ col ] , ( string ) $ b [ $ col ] ) : strnatcmp ( ( string ) $ b [ $ col ] , ( string ) $ a [ $ col ] ) ; } ) ; return $ items ; }
Order the table

@param  array $data
@return array
Order the table