<?php

namespace App\Admin\Extensions;

use Encore\Admin\Form\Field;

class FormQrCode extends Field
{
    protected $view = 'admin.form.qr_code';

    public function render()
    {
        $google2fa   = app('pragmarx.google2fa');
        $this->value = $google2fa->getQRCodeUrl(
            $this->data['username'],
            $this->data['name'],
            $this->data['g2fa_secret']
        );
        return parent::render();
    }
}