Download the PHP package webmonks/laravel-2fa without Composer

On this page you can find all versions of the php package webmonks/laravel-2fa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-2fa

Laravel 2FA

Latest Version on Packagist GitHub Tests Action Status Total Downloads PHP Version Require License

The definitive Laravel 2FA package with true plug-and-play architecture. Zero configuration required - works instantly with Laravel Mail, then scales to enterprise needs with WhatsApp, Voice, Push Notifications, and custom delivery providers.

Transform your Laravel authentication from basic to bulletproof in 30 seconds. Unlike other 2FA packages that force you into rigid patterns, Laravel 2FA v1.1 gives you the freedom to start simple and customize everything as your requirements evolve - now with global reach through WhatsApp, Voice calls, Push notifications, and intelligent fallback systems.

Why Laravel 2FA?

🚀 30-Second Setup: Install, migrate, protect routes - done. Email OTP works immediately with your existing Laravel Mail configuration.

🔌 True Plug & Play: Start with zero configuration, then customize anything. No vendor lock-in, no forced dependencies, no architectural constraints.

🎯 Production Battle-Tested: 96 comprehensive tests, 227 assertions, extensive security features, and real-world deployment experience.

🏗️ Enterprise-Ready Architecture: Multi-auth support, device trust management, comprehensive rate limiting, audit logging, and extensible provider system.

Key Features

🔐 Complete 2FA Methods

🛡️ Enterprise Security

🔧 Developer Experience

Requirements

Quick Start (30 Seconds)

1. Install & Setup

2. Prepare Your User Model

3. Protect Routes & Enable 2FA

That's it! Your routes are now protected with email-based 2FA using Laravel's built-in mail system.

Zero Configuration Philosophy

Laravel 2FA works instantly with your existing setup, then grows with your needs:

Complete Installation Guide

Basic Installation

Optional: Publish Configuration

Optional: SMS Provider Setup

For Twilio (Recommended)

For Vonage/Nexmo

For AWS SNS

Usage Examples

Email OTP (Zero Configuration)

SMS OTP (Once Provider Configured)

TOTP/Google Authenticator

Recovery Codes

Device Trust Management

New in v1.1: Advanced 2FA Methods

Laravel 2FA v1.1 introduces powerful new authentication methods for enhanced security and global reach.

WhatsApp OTP

Send verification codes via WhatsApp using Twilio WhatsApp or WhatsApp Business API.

Configuration

For Twilio WhatsApp:

For WhatsApp Business API:

Usage

Voice Call OTP

Deliver verification codes via voice calls with multi-language support and customizable voices.

Configuration

Usage

Additional SMS Providers

Enhanced SMS support with Vonage (formerly Nexmo) and AWS SNS, plus intelligent fallback chains.

Vonage/Nexmo Configuration

AWS SNS Configuration

SMS Provider Fallback

Configure fallback chains for maximum reliability:

Push Notifications

Implement push notification-based 2FA with approval workflows for mobile applications.

FCM (Firebase Cloud Messaging) Configuration

APNS (Apple Push Notification) Configuration

Push Notification Usage

Custom Delivery Providers

Extend Laravel 2FA with custom delivery methods like Slack, Discord, or Telegram.

Slack Integration Example

Discord Integration Example

Telegram Bot Integration

Advanced Fallback Configuration

Configure sophisticated fallback chains for maximum delivery reliability.

Environment Variables for v1.1 Features

Multi-Auth Guard Support

Laravel 2FA natively supports multiple authentication guards for complex applications:

Configuration

Usage with Guards

Advanced Features

Rate Limiting & Security

Audit Logging

Custom Email Templates

Custom SMS Provider

Register in your service provider:

API & JSON Responses

For API applications, Laravel 2FA provides structured JSON responses:

API Middleware

JSON Response Format

When 2FA is required, the middleware returns:

API Endpoints

Testing

Running Tests

Test Your Integration

Artisan Commands

Laravel 2FA includes helpful Artisan commands for management:

Configuration Reference

Core Configuration

Environment Variables

Performance & Optimization

Queue Configuration

Database Optimization

Caching

Security Considerations

Data Protection

Rate Limiting

Best Practices

  1. Use HTTPS: Always serve your application over HTTPS
  2. Secure Sessions: Use secure session configuration
  3. Monitor Logs: Enable audit logging and monitor for suspicious activity
  4. Regular Updates: Keep the package and dependencies updated
  5. Backup Recovery Codes: Ensure users safely store recovery codes
  6. Test Thoroughly: Test 2FA flows in staging before production

Troubleshooting

Common Issues

Email OTP Not Sending

SMS Issues

TOTP Sync Issues

WhatsApp Issues

Common WhatsApp Issues:

Voice Call Issues

Common Voice Issues:

Push Notification Issues

Common Push Issues:

SMS Provider Fallback Issues

Common Fallback Issues:

Custom Delivery Provider Issues

Common Custom Provider Issues:

Debug Mode

Monitoring & Analytics

Support Channels

Roadmap

✅ Version 1.1 (Released - January 2025)

Version 1.2 (Q2 2025)

Version 2.0 (Q3 2025)

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

Code Standards

Security Vulnerabilities

If you discover a security vulnerability, please send an email to [email protected]. All security vulnerabilities will be promptly addressed.

License

Laravel 2FA is open-sourced software licensed under the MIT License.

Credits


Ready to secure your Laravel application?

From zero to bulletproof authentication in 30 seconds. 🚀


All versions of laravel-2fa with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/auth Version ^10.0|^11.0|^12.0
illuminate/config Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/encryption Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/mail Version ^10.0|^11.0|^12.0
illuminate/notifications Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/session Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/validation Version ^10.0|^11.0|^12.0
pragmarx/google2fa Version ^8.0
bacon/bacon-qr-code Version ^2.0
web-auth/webauthn-lib Version ^4.9
ramsey/uuid Version ^4.7
nyholm/psr7 Version ^1.8
onelogin/php-saml Version ^4.1
firebase/php-jwt Version ^6.10
league/oauth2-client Version ^2.7
phpseclib/phpseclib Version ^3.0
ext-ldap Version *
ext-openssl Version *
rebing/graphql-laravel Version ^9.0
folklore/graphql Version ^5.0|^6.0
pusher/pusher-php-server Version ^7.2
laravel/passport Version ^11.0|^12.0
spatie/laravel-rate-limiting Version ^2.0
spatie/laravel-query-builder Version ^5.0
league/fractal Version ^0.20
doctrine/dbal Version ^3.0
pusher/pusher-http-php Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webmonks/laravel-2fa contains the following files

Loading the files please wait ...