private function applyWheres($builder)
    {
        // iterate over given where clauses
        return collect($this->builder->wheres)->map(function ($value, $key) {
            // for reduce function combine key and value into array
            return [$key, $value];
        })->reduce(function ($builder, $where) {
            // separate key, value again
            list($key, $value) = $where;
            return $builder->where($key, $value);
        }, $builder);
    }
private function applyWheres($builder)
    {
        // iterate over given where clauses
        return collect($this->builder->wheres)->map(function ($value, $key) {
            // for reduce function combine key and value into array
            return [$key, $value];
        })->reduce(function ($builder, $where) {
            // separate key, value again
            list($key, $value) = $where;
            return $builder->where($key, $value);
        }, $builder);
    }
private function applyWheres ( $ builder ) { // iterate over given where clauses return collect ( $ this -> builder -> wheres ) -> map ( function ( $ value , $ key ) { // for reduce function combine key and value into array return [ $ key , $ value ] ; } ) -> reduce ( function ( $ builder , $ where ) { // separate key, value again list ( $ key , $ value ) = $ where ; return $ builder -> where ( $ key , $ value ) ; } , $ builder ) ; }
Apply where statements as constraints to the query builder.

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