code: public function isValid(array $data = [])
      {
          if (empty($data)) {
              $data = http()->method() == 'GET' ? http()->get() : http()->post();
          }
          $this->data = $data;
  
          foreach ($this->rules as $key => $value) {
              $rules = explode('|', $value);
              foreach ($rules as $rule) {
                  if (strpos($rule, ',')) {
                      $group = explode(',', $rule);
                      $filter = $group[0];
                      $params = $group[1];
                      $this->errorMessage($filter, $key, $params);
                  } else {
                      $this->errorMessage($rule, $key);
                  }
              }
          }
  
          $this->errors = array_values(array_unique($this->errors));
          if (count($this->errors) > 0) {
              return false;
          }
  
          return true;
      }
docs: Validate
  
  @param array $data
  
  @return boolean