protected function metaJoinQuery(Builder $query, $method, ArgumentBag $args)
    {
        $alias = $this->joinMeta($query, $args->get('column'));

        // For aggregates we need the actual function name
        // so it can be called directly on the builder.
        $method = $args->get('function') ?: $method;

        return (in_array($method, ['orderBy', 'lists', 'pluck']))
            ? $this->{"{$method}Meta"}($query, $args, $alias)
            : $this->metaSingleResult($query, $method, $alias);
    }