<?php

namespace App\Classes\General\Eloquent\Filters;

use App\Classes\ValueObjects\Constants\KVPKey;
use Illuminate\Database\Eloquent\Builder;

class KeyValuePairIn implements Filter
{

    /**
     * @param Builder $builder
     * @param $value
     * @return Builder|mixed
     */
    public static function apply(Builder $builder, $value)
    {
        return $builder
            ->whereNull('owner_type')
            ->whereNull('owner_id')
            ->whereIn('key', [$value]);
    }
}
