From 365cbcca56e7aa13c504b743dc4e1e52a5e1adea Mon Sep 17 00:00:00 2001 From: Gabeta Soro Date: Tue, 2 Feb 2021 12:04:49 +0000 Subject: [PATCH] fix: #1 --- README.md | 1 - src/InteractWithLaraPnn.php | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b794de..9144d55 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,6 @@ class YourModel extends Model implements LaraPnnAbstract ]; } ``` - #### Basic usage: Migrate without change database value You can make a basic use of it which will migrate your numbers without modifying the values ​​in the database. diff --git a/src/InteractWithLaraPnn.php b/src/InteractWithLaraPnn.php index 6b348ef..41f6da7 100644 --- a/src/InteractWithLaraPnn.php +++ b/src/InteractWithLaraPnn.php @@ -12,7 +12,9 @@ public function getAttribute($key) { $attribute = parent::getAttribute($key); - if ((in_array($key, $this->pnnFields['mobile']) || in_array($key, $this->pnnFields['fix'])) + $pnnFields = call_user_func_array('array_merge', $this->pnnFields); + + if ((in_array($key, $pnnFields)) && $this->numberIsEligible($key, $attribute) && ! $this->migratePnnFromConsole) { return LaraPnnFacade::translateToNewPnnFormat($attribute); }