diff --git a/src/Location.php b/src/Location.php index 45b94c9..683ce31 100644 --- a/src/Location.php +++ b/src/Location.php @@ -82,12 +82,12 @@ public function setAttribute($key, $value) public function getAttribute($key) { $value = Arr::get($this->attributes, $key); - + + $method = 'get' . Str::studly($key) . 'Attribute'; + // First we will check for the presence of a mutator for the set operation // which simply lets the developers tweak the attribute as it is set. - if (method_exists($this, 'get' . Str::studly($key) . 'Attribute')) { - $method = 'get' . Str::studly($key) . 'Attribute'; - + if (method_exists($this, $method)) { return $this->{$method}($value); }