uri; } /** * Get Base32 encoded secret for manual entry */ public function getManualEntryKey(): string { return $this->secret->toFormattedBase32(); } /** * Get setup instructions for manual entry */ public function getManualSetupInstructions(): array { return [ 'account' => $this->accountName, 'issuer' => $this->issuer, 'secret' => $this->getManualEntryKey(), 'digits' => $this->digits, 'period' => $this->period, 'algorithm' => strtoupper($this->algorithm), ]; } /** * Convert to array for JSON responses */ public function toArray(): array { return [ 'qr_uri' => $this->uri, 'qr_code_svg' => $this->qrCodeSvg, 'qr_code_data_uri' => $this->qrCodeDataUri, 'manual_entry_key' => $this->getManualEntryKey(), 'account_name' => $this->accountName, 'issuer' => $this->issuer, 'digits' => $this->digits, 'period' => $this->period, 'algorithm' => $this->algorithm, 'setup_instructions' => $this->getManualSetupInstructions(), ]; } }