Skip to content

Commit 7ecd9b3

Browse files
committed
add the param $keyField to put in the now field
1 parent dbb3426 commit 7ecd9b3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

system/Validation/Rules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ public function required_with($str = null, ?string $fields = null, array $data =
280280
*
281281
* @param string|null $str
282282
*/
283-
public function required_without($str = null, ?string $fields = null, array $data = []): bool
283+
public function required_without($str = null, ?string $fields = null, array $data = [], string $keyField = null): bool
284284
{
285-
if ($fields === null || empty($data)) {
286-
throw new InvalidArgumentException('You must supply the parameters: fields, data.');
285+
if ($fields === null || empty($data) || $keyField === null) {
286+
throw new InvalidArgumentException('You must supply the parameters: fields, data, keyField.');
287287
}
288288

289289
// If the field is present we can safely assume that

system/Validation/Validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ protected function processRules(
312312
$found = true;
313313
$passed = $param === false
314314
? $set->{$rule}($value, $error)
315-
: $set->{$rule}($value, $param, $data, $error);
315+
: $set->{$rule}($value, $param, $data, $field);
316316

317317
break;
318318
}

0 commit comments

Comments
 (0)