public function prepare(callable $queryResolver)
    {
        // add custom conditions to unresolved
        $this->unresolved = $this->unresolved
            ->merge(collect($this->parameters)->except(self::getDefaultQueryParameters()))
            ->filter(function ($parameter) {
                return !is_null($parameter);
            })
            ->map(function ($parameter) {
                return new ValueExpression($parameter);
            });

        // parse where conditions
        if (array_has($this->parameters, 'where') && !is_null($this->parameters['where'])) {
            $this->parseWhere();
        }

        // parse includes for eager loading
        if (array_has($this->parameters, 'include') && !is_null($this->parameters['include'])) {
            $this->parseInclude();
        }

        // resolve query with caller
        if ($this->isUnresolved()) {
            $result = $queryResolver($this->getUnresolvedParameters(), $this);
            if (!is_bool($result) && !$result) {
                throw QueryException::unsuccesfulQueryException();
            }
        }
    }