/** * Adds mutator check before calling parent. * * @param string $key * * @return mixed */ public function __get($key) { $method = 'get' . studly_case($key) . 'Attribute'; if (method_exists($this, $method)) { return call_user_func([$this, $method]); } return parent::__get($key); }