src/Metable.php
public function scopeWhereMetaIn(Builder $q, string $key, array $values)
    {
        $values = array_map(function ($val) use ($key) {
            return is_string($val) ? $val : $this->makeMeta($key, $val)->getRawValue();
        }, $values);

        $q->whereHas('meta', function (Builder $q) use ($key, $values) {
            $q->where('key', $key);
            $q->whereIn('value', $values);
        });
    }
public function scopeWhereMetaIn(Builder $q, string $key, array $values)
    {
        $values = array_map(function ($val) use ($key) {
            return is_string($val) ? $val : $this->makeMeta($key, $val)->getRawValue();
        }, $values);

        $q->whereHas('meta', function (Builder $q) use ($key, $values) {
            $q->where('key', $key);
            $q->whereIn('value', $values);
        });
    }
public function scopeWhereMetaIn ( Builder $ q , string $ key , array $ values ) { $ values = array_map ( function ( $ val ) use ( $ key ) { return is_string ( $ val ) ? $ val : $ this -> makeMeta ( $ key , $ val ) -> getRawValue ( ) ; } , $ values ) ; $ q -> whereHas ( 'meta' , function ( Builder $ q ) use ( $ key , $ values ) { $ q -> where ( 'key' , $ key ) ; $ q -> whereIn ( 'value' , $ values ) ; } ) ; }
Query scope to restrict the query to records which have `Meta` with a specific key and a value within a specified set of options.

@param Builder $q
@param string  $key
@param array   $values

@return void
Query scope to restrict the query to records which have Meta with a specific key and a value within a specified set of options .