Being querying a model with eager loading.

@param  array|string  $relations
@return \Nova\Database\ORM\Builder|static
340894
public static function with($relations)
    {
        if (is_string($relations)) $relations = func_get_args();

        $instance = new static;

        return $instance->newQuery()->with($relations);
    }
1259459
public function with($relations = [])
    {
        if (! is_array($relations)) {
            $relations = [$relations];
        }

        $this->with = $relations;

        return $this;
    }
982029
public function newFromRelation(Relationship $relation)
    {
        $instance = new static($this->query, $this->parent, $this->related, $this->type, $this->attributes, $this->unique);

        $instance->setRelation($relation);

        return $instance;
    }
1063101
protected function assignRelations($relations)
    {
        foreach ($relations as $relation) {
            if (!$relation instanceof RelationInterface) {
                throw new ModelException(sprintf('Relation must be an instance of RelationInterface, got "%s"', $this->getType($relation)));
            }

            foreach (array_keys($relation->keys()) as $field) {
                $this->assertField($field);
            }

            $this->relations[$relation->name()] = $relation;
        }
    }
142525
public function loadRelation($relation)
    {
        //If the node isn't already loaded
        if(!isset($this->relationProxyCache[$relation->getId()]))
        {
            //Create a proxy entity
            $em = $this;
            $entity = $this->proxyFactory->fromRelation($relation, $this->metaRepository, function ($node) use ($em) {
                return $em->loadNode($node);
            });

            $this->relationProxyCache[$relation->getId()] = $entity;
            $this->everymanRelationCache[$this->getHash($entity)] = $relation;
        }

        return $this->relationProxyCache[$relation->getId()];
    }
1213718
public function matchOne(array $models, array $results, $relation)
    {
        $dictionary = $this->buildDictionary($results);

        foreach ($models as $model) {
            $key = $model->getAttribute($this->localKey);

            if (isset($dictionary[$key])) {
                $value = $this->getRelationValue($dictionary, $key, 'one');

                $model->setRelation($relation, $value);
            }
        }

        return $models;
    }
1134821
def with_(self, *relations):
        
        if not relations:
            return self

        eagers = self._parse_relations(list(relations))

        self._eager_load.update(eagers)

        return self
479021
public function orRelations(array $relations)
    {
        foreach ($relations as $column1 => $column2) {
            $this->orRelation($column1, $column2);
        }

        return $this;
    }
1308048
public function load($relations = [])
	{
		$this->addRelations($relations);
		
		$this->clearQueue();

		$this->queueUnresolvedObjects($this->data, $this->relations);

		$this->loadQueue();
	}
377401
public function loadCount($relations)
    {
        if ($this->isEmpty()) {
            return $this;
        }

        $models = $this->first()->newModelQuery()
            ->whereKey($this->modelKeys())
            ->select($this->first()->getKeyName())
            ->withCount(...func_get_args())
            ->get();

        $attributes = Arr::except(
            array_keys($models->first()->getAttributes()),
            $models->first()->getKeyName()
        );

        $models->each(function ($model) use ($attributes) {
            $this->find($model->getKey())->forceFill(
                Arr::only($model->getAttributes(), $attributes)
            )->syncOriginalAttributes($attributes);
        });

        return $this;
    }
419974
public function join($type, $table, array $relations = array())
    {
        $this->queryBuilder->join($type, $table, $relations);
        return $this;
    }
1089640
protected function parseWithRelations(array $relations)
    {
        $results = [];

        foreach ($relations as $name => $constraints) {
            // If the "relation" value is actually a numeric key, we can assume that no
            // constraints have been specified for the eager load and we'll just put
            // an empty Closure with the loader so that we can treat all the same.
            if (is_numeric($name)) {
                $name = $constraints;

                list($name, $constraints) = (mb_strpos($name, ':') !== false)
                            ? $this->createSelectWithConstraint($name)
                            : [$name, function () {
                                //
                            }];
            }

            // We need to separate out any nested includes. Which allows the developers
            // to load deep relationships using "dots" without stating each level of
            // the relationship with its own key in the array of eager load names.
            $results = $this->addNestedWiths($name, $results);

            $results[$name] = $constraints;
        }

        return $results;
    }
430556
public function with(array $relations)
    {
        $this->with = array_unique(array_merge($this->with, $relations));

        return $this;
    }
1259059
public function expand($relations)
    {
        if (is_string($relations)) {
            $relations = [$relations];
        }
        $relations = Set::normalize($relations);

        foreach ($relations as $path => $value) {
            $num = strpos($path, '.');
            $name = $num !== false ? substr($path, 0, $num) : $path;
            $rel = $this->relation($name);
            if ($rel->type() !== 'hasManyThrough') {
                continue;
            }
            $relPath = $rel->through() . '.' . $rel->using() . ($num !== false ? '.' . substr($path, $num + 1) : '');
            if (!isset($relations[$relPath])) {
                $relations[$relPath] = $relations[$path];
            }
        }
        return $relations;
    }
301492
public function orHavingRelations(array $relations)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->orHavingRelations($relations);

        return $instance;
    }
106795
public function initRelation(array $models, $relation)
    {
        foreach ($models as $model)
        {
            // In the case of fetching nested relations, we will get an array
            // with the first key being the model we need, and the other being
            // the related model so we'll just take the first model out of the array.
            if (is_array($model)) $model = reset($model);

            $model->setRelation($relation, $this->related->newCollection());
        }

        return $models;
    }
894762
protected function nestedRelations( $relation )
	{
		$nested = [];

		// We are basically looking for any relationships that are nested deeper than
		// the given top-level relationship. We will just check for any relations
		// that start with the given top relations and adds them to our arrays.
		foreach ( $this->eagerLoad as $name => $constraints )
		{
			if ( $this->isNested( $name, $relation ) )
			{
				$nested[substr( $name, strlen( $relation . '.' ) )] = $constraints;
			}
		}

		return $nested;
	}