/** * Get the country name * * @return string */ public function getCountryNameAttribute() { try { if ($this->CountryCode == '--' || empty($this->CountryCode)) { throw new Exception(); } $cc = MainHelper::countries($this->CountryCode); if ($cc === null) { throw new Exception(); } return $cc; } catch (Exception $e) { return 'Unknown'; } }