src/Metable.php
public function scopeWhereHasMetaKeys(Builder $q, array $keys)
    {
        $q->whereHas('meta', function (Builder $q) use ($keys) {
            $q->whereIn('key', $keys);
        }, '=', count($keys));
    }
public function scopeWhereHasMetaKeys(Builder $q, array $keys)
    {
        $q->whereHas('meta', function (Builder $q) use ($keys) {
            $q->whereIn('key', $keys);
        }, '=', count($keys));
    }
public function scopeWhereHasMetaKeys ( Builder $ q , array $ keys ) { $ q -> whereHas ( 'meta' , function ( Builder $ q ) use ( $ keys ) { $ q -> whereIn ( 'key' , $ keys ) ; } , '=' , count ( $ keys ) ) ; }
Query scope to restrict the query to records which have `Meta` for all of the provided keys.

@param Builder $q
@param array   $keys

@return void
Query scope to restrict the query to records which have Meta for all of the provided keys .