2, 'scale' => 8, ]); $qrcode = new QRCode($options); Log::info('data encoded to QR code'); return $qrcode->render($data); } /** * Decode an uploaded QR code image * * @param \Illuminate\Http\UploadedFile $file */ public function decode(\Illuminate\Http\UploadedFile $file) { $qrcode = new QrReader($file->get(), QrReader::SOURCE_TYPE_BLOB); $data = urldecode($qrcode->text()); if(!$data) { throw new \App\Exceptions\InvalidQrCodeException; } Log::info('QR code decoded'); return $data; } }