'integer', ]; /** * Relación polimórfica con cualquier modelo (User, Empresa, etc.) */ public function contactable() { return $this->morphTo(); } /** * Devuelve la información del tipo de contacto desde `settings` */ public function getTypeInfoAttribute() { return app(ContactableItemService::class)->getTypeById($this->type); } /** * Devuelve el nombre del tipo de contacto */ public function getTypeTextAttribute() { return $this->type_info['label'] ?? 'Desconocido'; } /** * Devuelve el icono del tipo de contacto */ public function getTypeIconAttribute() { return $this->type_info['icon'] ?? 'ti-help-circle'; } }