duplicateCode = $code; $this->duplicateId = $duplicateId; parent::__construct($message ?? __('error.item.duplicate_code')); } public function getDuplicateId(): int { return $this->duplicateId; } public function getDuplicateCode(): string { return $this->duplicateCode; } /** * HTTP 응답으로 변환 */ public function render() { return response()->json([ 'success' => false, 'message' => $this->getMessage(), 'error' => [ 'code' => 400, ], 'duplicate_id' => $this->duplicateId, 'duplicate_code' => $this->duplicateCode, ], 400); } }