Skip to content

Commit

Permalink
Update TranslatableFieldMixin.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo authored Apr 14, 2020
1 parent 510285a commit a0722b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TranslatableFieldMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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' => [
Expand Down

0 comments on commit a0722b4

Please # to comment.