Skip to content

Commit b60b19a

Browse files
[10.x] setValue() in Validator (#46716)
* Set value in validator * Update docblock * extra space in docs * Fix docblock again * Update Validator.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent c527625 commit b60b19a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Illuminate/Validation/Validator.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,18 @@ protected function getValue($attribute)
10861086
return Arr::get($this->data, $attribute);
10871087
}
10881088

1089+
/**
1090+
* Set the value of a given attribute.
1091+
*
1092+
* @param string $attribute
1093+
* @param mixed $value
1094+
* @return void
1095+
*/
1096+
public function setValue($attribute, $value)
1097+
{
1098+
Arr::set($this->data, $attribute, $value);
1099+
}
1100+
10891101
/**
10901102
* Get the validation rules.
10911103
*

0 commit comments

Comments
 (0)