protected function resolveQueryBuilderFromModel($model)
    {
        if ($this->isEloquentModel($model)) {
            return $model->newQuery();
        } elseif ($this->isEloquentRelationModel($model)) {
            return $model->getQuery();
        } elseif (! $this->isQueryBuilder($model)) {
            throw new InvalidArgumentException('Unable to load Query Builder from $model');
        }

        return $model;
    }
protected function resolveQueryBuilderFromModel($model)
    {
        if ($this->isEloquentModel($model)) {
            return $model->newQuery();
        } elseif ($this->isEloquentRelationModel($model)) {
            return $model->getQuery();
        } elseif (! $this->isQueryBuilder($model)) {
            throw new InvalidArgumentException('Unable to load Query Builder from $model');
        }

        return $model;
    }
protected function resolveQueryBuilderFromModel ( $ model ) { if ( $ this -> isEloquentModel ( $ model ) ) { return $ model -> newQuery ( ) ; } elseif ( $ this -> isEloquentRelationModel ( $ model ) ) { return $ model -> getQuery ( ) ; } elseif ( ! $ this -> isQueryBuilder ( $ model ) ) { throw new InvalidArgumentException ( 'Unable to load Query Builder from $model' ) ; } return $ model ; }
Resolve query builder from model instance.

@param  mixed  $model

@throws \InvalidArgumentException

@return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder
Resolve query builder from model instance .