public function getBuilder($model)
    {
        // get query as given constraint or create a new query
        $builder = isset($this->builder->constraints) ? $this->builder->constraints : $model->newQuery();

        $builder = $this->handleSoftDeletes($builder, $model);

        $builder = $this->applyWheres($builder);

        $builder = $this->applyOrders($builder);

        return $builder;
    }
public function getBuilder($model)
    {
        // get query as given constraint or create a new query
        $builder = isset($this->builder->constraints) ? $this->builder->constraints : $model->newQuery();

        $builder = $this->handleSoftDeletes($builder, $model);

        $builder = $this->applyWheres($builder);

        $builder = $this->applyOrders($builder);

        return $builder;
    }
public function getBuilder ( $ model ) { // get query as given constraint or create a new query $ builder = isset ( $ this -> builder -> constraints ) ? $ this -> builder -> constraints : $ model -> newQuery ( ) ; $ builder = $ this -> handleSoftDeletes ( $ builder , $ model ) ; $ builder = $ this -> applyWheres ( $ builder ) ; $ builder = $ this -> applyOrders ( $ builder ) ; return $ builder ; }
Return query builder either from given constraints, or as
new query. Add where statements to builder when given.

@param \Illuminate\Database\Eloquent\Model $model

@return Builder
Return query builder either from given constraints or as new query . Add where statements to builder when given .