diff --git a/src/TranslatableFieldMixin.php b/src/TranslatableFieldMixin.php index d8660ff..32ae0c4 100644 --- a/src/TranslatableFieldMixin.php +++ b/src/TranslatableFieldMixin.php @@ -41,7 +41,7 @@ public function translatable() $value = data_get($resource, str_replace('->', '.', $attribute)); } - $value = array_map(fn ($val) => is_nan($val) ? $val : floatval($val), (array) $value); + $value = array_map(fn ($val) => is_numeric($val) ? $val : floatval($val), (array) $value); $this->component = 'translatable-field'; @@ -83,7 +83,7 @@ public function translatable() $value = data_get($resource, str_replace('->', '.', $attribute)); } - $value = array_map(fn ($val) => is_nan($val) ? $val : floatval($val), (array) $value); + $value = array_map(fn ($val) => is_numeric($val) ? $val : floatval($val), (array) $value); $this->withMeta([ 'translatable' => [