evgen-dev/google-authenticator

Laravel/GoogleAuthenticator - generate and check OTP

v0.1.2 2025-02-06 12:17 UTC

This package is auto-updated.

Last update: 2025-06-08 15:10:17 UTC


README

Laravel 10.x simple Google Authenticator 2FA auth support.

Installation

Install using composer

composer require evgen-dev/google-authenticator

Add the provider to config/app.php

'providers' => [
    EvgenDev\GoogleAuthenticator\GoogleAuthenticatorServiceProvider::class,
]

Using

use EvgenDev\GoogleAuthenticator\Facades\GoogleAuthenticator;

GoogleAuthenticator::getCode('YOUR_SECRET_STRING');
GoogleAuthenticator::checkCode('YOUR_SECRET_STRING', 'YOUR_CODE');
GoogleAuthenticator::getQRCodeUrl('username', 'example.org', 'YOUR_SECRET_STRING');
GoogleAuthenticator::generateSecret();