/**
  * Return true if key and value are registered values.
  *
  * @param string $key
  * @param mixed  $value
  *
  * @return bool
  */
 public function isValid($key, $value)
 {
     $settings = collect($this->getRegistered()->get($key, ['allowed' => []]));
     $allowed = $settings->get('allowed');
     if (!is_array($allowed) && ($rule = $this->ruleValidator->isRule($allowed))) {
         return $this->ruleValidator->validate($rule, $value);
     }
     return in_array($value, $allowed, true);
 }