This commit is contained in:
2024-01-10 17:35:55 +08:00
parent 21aca8b642
commit 2c554e765c
+2 -3
View File
@@ -94,15 +94,14 @@ class Validator extends BaseValidator
/** /**
* @param ModelInterface $model * @param array $attributes
* @return bool * @return bool
*/ */
public function validation(ModelInterface $model): bool public function validation(array $attributes): bool
{ {
if (count($this->validators) < 1) { if (count($this->validators) < 1) {
return true; return true;
} }
$attributes = $model->getChanges();
foreach ($attributes as $field => $attribute) { foreach ($attributes as $field => $attribute) {
if (isset($this->validators[$field])) { if (isset($this->validators[$field])) {
$validator = $this->validators[$field]; $validator = $this->validators[$field];