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); }