Skip to content

Commit

Permalink
fix: patch up array error on php 8+
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 12, 2023
1 parent dc268a8 commit 9fb5aee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static function validate(array $data, array $rules)

$errorMessage = str_replace(
['{field}', '{Field}', '{value}'],
[$field, ucfirst($field), $value],
[$field, ucfirst($field), is_array($value) ? json_encode($value) : $value],
static::$messages[$rule[0]] ?? static::$messages[explode('(', $rule[0])[0] ?? 'any'] ?? '{Field} is invalid!'
);

Expand Down

0 comments on commit 9fb5aee

Please sign in to comment.