first
This commit is contained in:
21
app/Admin/Extensions/FormQrCode.php
Normal file
21
app/Admin/Extensions/FormQrCode.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user