alt-design/alt-google-2fa
| Install | |
|---|---|
composer require alt-design/alt-google-2fa |
|
| Latest Version: | v1.2.0 |
| PHP: | ^8.2 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Nov 6, 2026 |
| Links: | GitHub · Packagist |
Alt Google 2FA Addon
Google 2FA - just not requiring like, an hour of setup and config.
Heavily uses https://github.com/antonioribeiro/google2fa-laravel - big shout out 🫶
Features
- Select who needs 2FA enforced by super users and roles
- Select optional user roles that can access 2FA
- Works on Front End and Control Panel
How to Install
composer require alt-design/alt-google-2fa
Basic usage
Settings
Just nip into the settings, few options
- Enforced / Optional / Off
- Enforced - Users matching the criteria have to have 2FA on to access the site.
- Optional - As it says on the tin, the routes are available if you fancy.
- Off - Just turns off the 2FA requirements for Super Users
Using your own template
Want to use your own template? Don't blame ya! Luckily we've built a tag in to generate the QR code. Template just needs to vaguely look like this:
<!-- QR Tag -->
<s:AltGoogle2FA /> (Blade) or {{ alt-google-2fa }} if you're using Antlers)
<!-- OTP Form ->
<form action="{{ route('alt-google-2fa.verify') }}" method="POST">
@csrf
<input name="one_time_password" type="text" placeholder="OTP Code">
<button type="submit" class="btn btn-primary">Authenticate</button>
</form>
<!-- Just so people don't get stuck -->
<a href="{{ route('statamic.logout') }}">
Cancel & Logout
</a>
Example manual inclusion of enabling/disabling 2FA.
{{ if {AltGoogle2FA:is-enabled} }}
<a href="https://github.com/alt-design/Alt-Google-2fa-Addon/blob/HEAD/{{ route:alt-google-2fa.disable-2fa }}">Disable</a>
{{ else }}
<a href="https://github.com/alt-design/Alt-Google-2fa-Addon/blob/HEAD/{{ route:alt-google-2fa.enable-2fa }}">Enable</a>
{{ /if }}
Using Database Users?
No problemo! You'll just need to publish the database migration and run it!
php artisan vendor:publish --tag=alt-google-2fa-migrations
php artisan migrate
Locked yourself out
Oop - you can just disable the settings using the content/alt-google-2fa/settings.yaml, or remove the 2FA field values on your user.
Questions etc
Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.
Also - check out our other Statamic bits!
Starter Kits
Addons
- Alt SEO Addon
- Alt Redirect Addon
- Alt Sitemap Addon
- Alt Akismet Addon
- Alt Password Protect Addon
- Alt Cookies Addon
- Alt Inbound Addon
Postcardware
Send us a postcard from your hometown if you like this addon. We love getting mail from other cool peeps!
Alt Design
St Helens House
Derby
DE1 3EE
UK
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v1.2.0 | ^8.2 | MIT | |
| v1.1.3 | ^8.2 | MIT | |
| v1.1.2 | ^8.2 | MIT | |
| v1.1.1 | ^8.2 | MIT | |
| v1.1.0 | ^8.2 | MIT | |
| v1.0.10 | ^8.2 | MIT | |
| v1.0.9 | ^8.2 | MIT | |
| v1.0.8 | ^8.2 | MIT | |
| v1.0.7 | ^8.2 | MIT | |
| v1.0.6 | ^8.2 | MIT | |
| v1.0.5 | ^8.2 | MIT | |
| v1.0.4 | ^8.2 | MIT | |
| v1.0.3 | ^8.2 | MIT | |
| v1.0.2 | ^8.2 | MIT | |
| v1.0.1 | ^8.2 | MIT | |
| v1.0.0 | ^8.2 | MIT |