[GH-ISSUE #58] Not found class PragmaRX\Google2FA\Google2FA #28

Closed
opened 2026-02-25 20:32:13 +03:00 by kerem · 8 comments
Owner

Originally created by @sozonets on GitHub (Mar 29, 2017).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/58

use PragmaRX\Google2FA\Google2FA;

        $gFA = new Google2FA();

        $imageDataUri = $gFA->getQRCodeInline(
            $request->getHttpHost(),
            $user->email,
            $secret,
            200
        );

Class 'PragmaRX\Google2FA\Google2FA' not found
How to fix for Laravel 5.3 ?

Originally created by @sozonets on GitHub (Mar 29, 2017). Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/58 ``` use PragmaRX\Google2FA\Google2FA; $gFA = new Google2FA(); $imageDataUri = $gFA->getQRCodeInline( $request->getHttpHost(), $user->email, $secret, 200 ); ``` Class 'PragmaRX\Google2FA\Google2FA' not found How to fix for Laravel 5.3 ?
kerem closed this issue 2026-02-25 20:32:13 +03:00
Author
Owner

@yurik94 commented on GitHub (Jun 21, 2017):

How did you fix? same error :(

<!-- gh-comment-id:310057436 --> @yurik94 commented on GitHub (Jun 21, 2017): How did you fix? same error :(
Author
Owner

@sozonets commented on GitHub (Jun 21, 2017):

composer update fix it
or
Completely reload the entire project on your server

<!-- gh-comment-id:310058202 --> @sozonets commented on GitHub (Jun 21, 2017): `composer update` fix it or Completely reload the entire project on your server
Author
Owner

@yurik94 commented on GitHub (Jun 21, 2017):

something has been changed in the repo name I suspect, and in the namespaces too:

Correct usage on the Laravel bridge (5.4), /config/app.php:

PragmaRX\Google2FALaravel\ServiceProvider::class,

'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,

<!-- gh-comment-id:310062582 --> @yurik94 commented on GitHub (Jun 21, 2017): something has been changed in the repo name I suspect, and in the namespaces too: Correct usage on the Laravel bridge (5.4), /config/app.php: PragmaRX\Google2FALaravel\ServiceProvider::class, 'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
Author
Owner

@antonioribeiro commented on GitHub (Jun 21, 2017):

Sorry about that. That's basically why I tagged a new major. And the docs were wrong, I just fix this info in the bridge package.

<!-- gh-comment-id:310077290 --> @antonioribeiro commented on GitHub (Jun 21, 2017): Sorry about that. That's basically why I tagged a new major. And the docs were wrong, I just fix this info in the bridge package.
Author
Owner

@yurik94 commented on GitHub (Jun 21, 2017):

Nevermind, I've followed this

https://www.sitepoint.com/2fa-in-laravel-with-google-authenticator-get-secure/

and I just finished the 2FA 👍
Anyway there's something that should be updated on that tutorial but I can confirm it's working on 5.4.

P.S. I'm working on Php 7.1 and there are some non-static methods called statically 😄

<!-- gh-comment-id:310090403 --> @yurik94 commented on GitHub (Jun 21, 2017): Nevermind, I've followed this [https://www.sitepoint.com/2fa-in-laravel-with-google-authenticator-get-secure/](https://www.sitepoint.com/2fa-in-laravel-with-google-authenticator-get-secure/) and I just finished the 2FA 👍 Anyway there's something that should be updated on that tutorial but I can confirm it's working on 5.4. P.S. I'm working on Php 7.1 and there are some non-static methods called statically 😄
Author
Owner

@henriquepalazzo commented on GitHub (Nov 13, 2017):

Getting the same error here with Laravel 5.5: Class pragmarx.google2fa does not exist. I already tried composer update and many other things, still not working.

<!-- gh-comment-id:343904054 --> @henriquepalazzo commented on GitHub (Nov 13, 2017): Getting the same error here with Laravel 5.5: Class pragmarx.google2fa does not exist. I already tried composer update and many other things, still not working.
Author
Owner

@antonioribeiro commented on GitHub (Nov 13, 2017):

@yurik94 , if you look at the class source: https://github.com/antonioribeiro/google2fa/blob/master/src/Google2FA.php, you'll see there are no static methods, so this must be a Laravel Facade thing or something you are doing.

<!-- gh-comment-id:343904837 --> @antonioribeiro commented on GitHub (Nov 13, 2017): @yurik94 , if you look at the class source: https://github.com/antonioribeiro/google2fa/blob/master/src/Google2FA.php, you'll see there are no static methods, so this must be a Laravel Facade thing or something you are doing.
Author
Owner

@antonioribeiro commented on GitHub (Nov 13, 2017):

@henriquepalazzo, I can confirm it works fine on Laravel 5.5. Usually this happens when the service provider was not registered. But you may be using the wrong package, this is the Laravel version of this package: https://github.com/antonioribeiro/google2fa-laravel

<!-- gh-comment-id:343905197 --> @antonioribeiro commented on GitHub (Nov 13, 2017): @henriquepalazzo, I can confirm it works fine on Laravel 5.5. Usually this happens when the service provider was not registered. But you may be using the wrong package, this is the Laravel version of this package: https://github.com/antonioribeiro/google2fa-laravel
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/google2fa#28
No description provided.