private function applyOrders($builder)
    {
        //iterate over given orderBy clauses - should be only one
        return collect($this->builder->orders)->map(function ($value, $key) {
            // for reduce function combine key and value into array
            return [$value["column"], $value["direction"]];
        })->reduce(function ($builder, $orderBy) {
            // separate key, value again
            list($column, $direction) = $orderBy;
            return $builder->orderBy($column, $direction);
        }, $builder);
    }
private function applyOrders($builder)
    {
        //iterate over given orderBy clauses - should be only one
        return collect($this->builder->orders)->map(function ($value, $key) {
            // for reduce function combine key and value into array
            return [$value["column"], $value["direction"]];
        })->reduce(function ($builder, $orderBy) {
            // separate key, value again
            list($column, $direction) = $orderBy;
            return $builder->orderBy($column, $direction);
        }, $builder);
    }
private function applyOrders ( $ builder ) { //iterate over given orderBy clauses - should be only one return collect ( $ this -> builder -> orders ) -> map ( function ( $ value , $ key ) { // for reduce function combine key and value into array return [ $ value [ "column" ] , $ value [ "direction" ] ] ; } ) -> reduce ( function ( $ builder , $ orderBy ) { // separate key, value again list ( $ column , $ direction ) = $ orderBy ; return $ builder -> orderBy ( $ column , $ direction ) ; } , $ builder ) ; }
Apply order by statements as constraints to the query builder.

@param Builder $builder
@return \Illuminate\Support\Collection
Apply order by statements as constraints to the query builder .