From 295f7b7ee93d18d958b38f74031703974ac9d4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 21 Feb 2026 00:56:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[card]=20CSV(CVC)=20=EB=B3=B5=ED=98=B8?= =?UTF-8?q?=ED=99=94=20=EA=B0=92=EC=9D=84=20API=20=EC=9D=91=EB=8B=B5?= =?UTF-8?q?=EC=97=90=20=ED=8F=AC=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - $appends에 csv 추가, getCsvAttribute accessor 생성 - cvc_encrypted는 $hidden 유지 (암호문 노출 방지) --- app/Models/Tenants/Card.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Models/Tenants/Card.php b/app/Models/Tenants/Card.php index 757f04c..a8a4cc8 100644 --- a/app/Models/Tenants/Card.php +++ b/app/Models/Tenants/Card.php @@ -73,6 +73,10 @@ class Card extends Model 'cvc_encrypted', ]; + protected $appends = [ + 'csv', + ]; + protected $attributes = [ 'status' => 'active', 'is_manual' => false, @@ -178,6 +182,18 @@ public function getDecryptedCvc(): ?string : null; } + // ========================================================================= + // Accessor (JSON 직렬화용) + // ========================================================================= + + /** + * CSV(CVC) 복호화 값 — $appends로 JSON 응답에 포함 + */ + public function getCsvAttribute(): ?string + { + return $this->getDecryptedCvc(); + } + // ========================================================================= // 헬퍼 메서드 // =========================================================================