From a0722b4052585b3a85d8e86a3d14919fb3205163 Mon Sep 17 00:00:00 2001 From: Tarvo R Date: Tue, 14 Apr 2020 20:43:35 +0300 Subject: [PATCH] Update TranslatableFieldMixin.php --- src/TranslatableFieldMixin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' => [