src/Metable.php
protected function getMetaWhereConstraint($method, ArgumentBag $args)
    {
        $column = $args->get('column');

        $args->set('column', 'meta_value');

        if ($method === 'whereBetween') {
            return $this->getMetaBetweenConstraint($column, $args->get('values'));
        }

        return function ($query) use ($column, $method, $args) {
            $query->where('meta_key', $column);

            if ($args->get('value') || $args->get('values')) {
                call_user_func_array([$query, $method], $args->all());
            }
        };
    }
protected function getMetaWhereConstraint($method, ArgumentBag $args)
    {
        $column = $args->get('column');

        $args->set('column', 'meta_value');

        if ($method === 'whereBetween') {
            return $this->getMetaBetweenConstraint($column, $args->get('values'));
        }

        return function ($query) use ($column, $method, $args) {
            $query->where('meta_key', $column);

            if ($args->get('value') || $args->get('values')) {
                call_user_func_array([$query, $method], $args->all());
            }
        };
    }
Get the relation constraint closure.

@param  string $method
@param  \Sofa\Hookable\Contracts\ArgumentBag $args
@return \Closure