fix: if_exist does not work with array data

This commit is contained in:
kenjis 2024-06-12 10:28:10 +09:00
parent 33477f8d4e
commit 1ca24da3d4
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,10 @@ class FormatRules
*/
public function alpha($str = null): bool
{
if (is_array($str)) {
return false;
}
if (! is_string($str)) {
$str = (string) $str;
}

View File

@ -399,8 +399,10 @@ class Validation implements ValidationInterface
break;
}
}
} else {
} elseif (str_contains($field, '.')) {
$dataIsExisting = array_key_exists($ifExistField, $flattenedData);
} else {
$dataIsExisting = array_key_exists($ifExistField, $data);
}
if (! $dataIsExisting) {