Skip to content

Commit 619a2b3

Browse files
committed
Make sure rule using validated attribute
1 parent 982f2e9 commit 619a2b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Validation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ protected function validateAttribute(Attribute $attribute)
7474
$attributeKey = $attribute->getKey();
7575
$rules = $attribute->getRules();
7676

77-
7877
$value = $this->getValue($attributeKey);
7978
$isEmptyValue = $this->isEmptyValue($value);
8079

8180
$isValid = true;
8281
foreach($rules as $ruleValidator) {
82+
$ruleValidator->setAttribute($attribute);
83+
8384
if ($isEmptyValue && $ruleValidator instanceof Defaults) {
8485
$value = $ruleValidator->check(null);
8586
$isEmptyValue = $this->isEmptyValue($value);

0 commit comments

Comments
 (0)