'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', 'barobill_pwd' => 'encrypted', // 복호화 가능한 암호화 (바로빌 API 호출 시 필요) ]; protected $hidden = [ 'barobill_pwd', ]; /** * 테넌트 관계 */ public function tenant(): BelongsTo { return $this->belongsTo(Tenant::class); } /** * 사업자번호 포맷팅 (XXX-XX-XXXXX) */ public function getFormattedBizNoAttribute(): string { $bizNo = preg_replace('/[^0-9]/', '', $this->biz_no); if (strlen($bizNo) === 10) { return substr($bizNo, 0, 3) . '-' . substr($bizNo, 3, 2) . '-' . substr($bizNo, 5); } return $this->biz_no; } /** * 상태 라벨 */ public function getStatusLabelAttribute(): string { return match ($this->status) { 'active' => '활성', 'inactive' => '비활성', 'pending' => '대기중', default => $this->status, }; } /** * 상태별 색상 클래스 */ public function getStatusColorAttribute(): string { return match ($this->status) { 'active' => 'bg-green-100 text-green-800', 'inactive' => 'bg-gray-100 text-gray-800', 'pending' => 'bg-yellow-100 text-yellow-800', default => 'bg-gray-100 text-gray-800', }; } }