public function compileOrders()
    {
        if (!$this->orders) {
            return;
        }

        foreach ($this->orders as $order) {
            $column = $order['column'];
            $direction = $order['direction'];

            $compiled = strtolower($direction) == 'asc'
                ? r\asc($column) : r\desc($column);

            // Use index as field if needed
            if ($order['index']) {
                $compiled = ['index' => $compiled];
            }

            $this->query->orderBy($compiled);
        }
    }
public function compileOrders()
    {
        if (!$this->orders) {
            return;
        }

        foreach ($this->orders as $order) {
            $column = $order['column'];
            $direction = $order['direction'];

            $compiled = strtolower($direction) == 'asc'
                ? r\asc($column) : r\desc($column);

            // Use index as field if needed
            if ($order['index']) {
                $compiled = ['index' => $compiled];
            }

            $this->query->orderBy($compiled);
        }
    }
public function compileOrders ( ) { if ( ! $ this -> orders ) { return ; } foreach ( $ this -> orders as $ order ) { $ column = $ order [ 'column' ] ; $ direction = $ order [ 'direction' ] ; $ compiled = strtolower ( $ direction ) == 'asc' ? r \ asc ( $ column ) : r \ desc ( $ column ) ; // Use index as field if needed if ( $ order [ 'index' ] ) { $ compiled = [ 'index' => $ compiled ] ; } $ this -> query -> orderBy ( $ compiled ) ; } }
Compile orders into query.
Compile orders into query .