qrcodeService = $qrcodeService; $this->twofaccountService = $twofaccountService; } /** * Show a QR code image * * @param App\Models\TwoFAccount $twofaccount * @return \Illuminate\Http\JsonResponse */ public function show(TwoFAccount $twofaccount) { $uri = $this->twofaccountService->getURI($twofaccount); return response()->json(['qrcode' => $this->qrcodeService->encode($uri)], 200); } /** * Decode an uploaded QR Code image * * @param \App\Api\v1\Requests\QrCodeDecodeRequest $request * @return \Illuminate\Http\JsonResponse */ public function decode(QrCodeDecodeRequest $request) { $file = $request->file('qrcode'); return response()->json(['data' => $this->qrcodeService->decode($file)], 200); } }