Get a new query builder that only includes offline items.

@return \Illuminate\Database\Eloquent\Builder|static
546067
public static function onlyOffline()
    {

        $instance = new static;

        $column = $instance->getQualifiedStatusColumn();

        return $instance->withoutGlobalScope(StatusScope::class)->where($column, false);
    }
579553
protected function loadQuery(): Query
    {
        return Query::select($this->getFieldsNames())
            ->from(static::$tableName)
            ->where($this->where ?? $this->getPKValue());
    }
645476
public function buildQuery()
    {
        $model = $this->model;
        $query = $model::query();

        // perform joins
        if (is_array($this->join)) {
            foreach ($this->join as $condition) {
                list($joinModel, $column, $foreignKey) = $condition;
                $query->join($joinModel, $column, $foreignKey);
            }
        }

        // sanitze and set the filter
        $filter = $this->parseFilterInput($this->filter);
        $query->where($filter);

        // performs a search using LIKE queries
        // WARNING use sparingly, these queries are expensive
        if (!empty($this->search) && is_string($this->search) && property_exists($model, 'searchableProperties')) {
            $w = [];
            $search = addslashes($this->search);
            foreach ($model::$searchableProperties as $name) {
                $w[] = "`$name` LIKE '%$search%'";
            }

            if (count($w) > 0) {
                $query->where('('.implode(' OR ', $w).')');
            }
        }

        // eager loading
        foreach ($this->expand as $k) {
            $property = $model::getProperty($k);
            if ($property && isset($property['relation'])) {
                if (isset($property['id_property'])) {
                    $query->with($property['id_property']);
                } else {
                    $query->with($k);
                }
            }
        }

        if (isset($this->sort)) {
            $query->sort($this->sort);
        }

        // calculate limit and offset
        $start = ($this->page - 1) * $this->perPage;
        $query->start($start)->limit($this->perPage);

        return $query;
    }
1088147
public function getStubQueryBuilder()
    {
        if (!isset($this->stubQueryBuilder)) {
            $this->stubQueryBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'querystub');
        }

        return $this->stubQueryBuilder;
    }
201210
public function build()
    {
        $query = $this->delegate->build();
        $this->utilityRegistry->addUtility(AdsUtility::SERVICE_QUERY_BUILDER);
        return $query;
    }
116212
public function newQuery()
    {
        $builder = new self($this->mapper, $this->adapter);

        return $this->applyGlobalScopes($builder);
    }
911030
public function newRawQuery()
    {
        $builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());

        // Once we have the query builders, we will set the model instances
        // so the builder can easily access any information it may need
        // from the model while it is constructing and executing various
        // queries against it.
        $builder->setModel($this)->with($this->with);
        return $builder;
    }
358077
protected function getQuery()
    {
        $query = new Query();

        if ($this->valid()) {
            $query->setQuery(new GtNode($this->dataStore->getIdentifier(), $this->key()));
        }

        $query->setLimit(new LimitNode($this->limit));
        $query->setSort(new SortNode([$this->dataStore->getIdentifier() => SortNode::SORT_ASC]));

        return $query;
    }
1203724
protected function createFindQuery(): QueryBuilder
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->select('id', 'locale', 'name', 'disabled')
            ->from('ezcontent_language');

        return $query;
    }
1198849
public function query() : Builder
	{
		if (trim($seed = $this->seed) !== '') {
			$this->builder->where(function ($query) use ($seed) {
				return $this->resolveQuery($query, $seed);
			});
		}

		return $this->builder;
	}
1080290
public function newQuery($excludeDeleted = true) {
    $builder = parent::newQuery($excludeDeleted);
    $builder->where(static::$table_type_field, '=', $this->table_type);

    return $builder;
  }
929212
public function useBoostQueriesFromTypoScript(): QueryBuilder
    {
        $searchConfiguration = $this->typoScriptConfiguration->getSearchConfiguration();

        if (!empty($searchConfiguration['query.']['boostQuery'])) {
            return $this->useBoostQueries($searchConfiguration['query.']['boostQuery']);
        }

        if (!empty($searchConfiguration['query.']['boostQuery.'])) {
            $boostQueries = $searchConfiguration['query.']['boostQuery.'];
            return $this->useBoostQueries(array_values($boostQueries));
        }

        return $this;
    }
819814
public function newQuery($excludeDeleted = true)
    {
        $builder = parent::newQuery($excludeDeleted);

        if ($this->isSubType())
        {
            $builder->where($this->typeField, $this->getClass($this->typeField));
        }

        return $builder;
    }
353329
public function query() : Builder
	{
		if (is_null($this->category_id)) {
			return $this->builder;
		}

		if (count($children = $this->children()) > 0) {
			$this->builder->whereIn('category_id', $children);
		}

		return $this->builder;
	}
1088656
public function newQuery()
    {
        return new static(
            $this->cache,
            $this->connection,
            $this->grammar,
            $this->processor,
            $this->cacheTag
        );
    }
910463
public function getQueryBuilder()
    {
        if ( ! $this->queryBuilder instanceof AbstractQueryBuilder) {
            $className = str_replace('Connection', 'QueryBuilder', get_called_class());

            if (class_exists($className)) {
                $this->queryBuilder = new $className($this);
            }
        }

        return $this->queryBuilder;
    }
12110
public static function query()
    {
        if (static::$builder instanceof Builder) {
            if (static::$builder->getModel() == static::class) {
                return static::$builder;
            }
        }

        // Reflection action
        $reflection = new \ReflectionClass(static::class);

        $properties = $reflection->getDefaultProperties();

        if ($properties['table'] == null) {
            $parts = explode('\\', static::class);

            $table = end($parts);

            $table = Str::camel(strtolower($table)).'s';
        } else {
            $table = $properties['table'];
        }

        if (!is_null($properties['connexion'])) {
            DB::connection($properties['connexion']);
        }

        if (!is_null($properties['prefix'])) {
            $prefix = $properties['prefix'];
        } else {
            $prefix = DB::getConnectionAdapter()->getTablePrefix();
        }

        $table = $prefix.$table;

        static::$builder = new Builder($table, DB::getPdo());

        static::$builder->setPrefix($prefix);

        static::$builder->setModel(static::class);

        return static::$builder;
    }