src/Metable.php
protected function metaHasQuery(Builder $query, $method, ArgumentBag $args)
    {
        $boolean = $this->getMetaBoolean($args);

        $operator = $this->getMetaOperator($method, $args);

        if (in_array($method, ['whereBetween', 'where'])) {
            $this->unbindNumerics($args);
        }

        return $query
            ->has('metaAttributes', $operator, 1, $boolean, $this->getMetaWhereConstraint($method, $args))
            ->with('metaAttributes');
    }
protected function metaHasQuery(Builder $query, $method, ArgumentBag $args)
    {
        $boolean = $this->getMetaBoolean($args);

        $operator = $this->getMetaOperator($method, $args);

        if (in_array($method, ['whereBetween', 'where'])) {
            $this->unbindNumerics($args);
        }

        return $query
            ->has('metaAttributes', $operator, 1, $boolean, $this->getMetaWhereConstraint($method, $args))
            ->with('metaAttributes');
    }
Add whereHas subquery on the meta attributes relation.

@param  \Sofa\Eloquence\Builder $query
@param  string $method
@param  \Sofa\Hookable\Contracts\ArgumentBag $args
@return \Sofa\Eloquence\Builder