src/Google2FA.php
public function getQRCodeInlineV2($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
    {
        $renderer = new ImageRenderer(
            (new RendererStyle($size))->withSize($size),
            $this->imageBackEnd
        );

        $bacon = new Writer($renderer);

        $data = $bacon->writeString(
            $this->getQRCodeUrl($company, $holder, $secret),
            $encoding
        );

        if ($this->imageBackEnd instanceof ImagickImageBackEnd) {
            return 'data:image/png;base64,'.base64_encode($data);
        }

        return $data;
    }
public function getQRCodeInlineV2($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
    {
        $renderer = new ImageRenderer(
            (new RendererStyle($size))->withSize($size),
            $this->imageBackEnd
        );

        $bacon = new Writer($renderer);

        $data = $bacon->writeString(
            $this->getQRCodeUrl($company, $holder, $secret),
            $encoding
        );

        if ($this->imageBackEnd instanceof ImagickImageBackEnd) {
            return 'data:image/png;base64,'.base64_encode($data);
        }

        return $data;
    }
public function getQRCodeInlineV2 ( $ company , $ holder , $ secret , $ size = 200 , $ encoding = 'utf-8' ) { $ renderer = new ImageRenderer ( ( new RendererStyle ( $ size ) ) -> withSize ( $ size ) , $ this -> imageBackEnd ) ; $ bacon = new Writer ( $ renderer ) ; $ data = $ bacon -> writeString ( $ this -> getQRCodeUrl ( $ company , $ holder , $ secret ) , $ encoding ) ; if ( $ this -> imageBackEnd instanceof ImagickImageBackEnd ) { return 'data:image/png;base64,' . base64_encode ( $ data ) ; } return $ data ; }
Generates a QR code data url to display inline for Bacon QRCode v2

@param string $company
@param string $holder
@param string $secret
@param int    $size
@param string $encoding Default to UTF-8

@return string
Generates a QR code data url to display inline for Bacon QRCode v2