skywalker-labs / laraguard
On-premises 2FA Authentication for all your users out-of-the-box
Fund package maintenance!
Requires
- php: ^8.1|^8.2|^8.3|^8.4
- ext-json: *
- illuminate/auth: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/config: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/database: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/http: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/validation: ^8.0|^9.0|^10.0|^11.0|^12.0
- skywalker-labs/constant-time-encoding: 1.0
- skywalker-labs/qr-code: ^1.0
- skywalker-labs/toolkit: ^1.0|^2.0
Requires (Dev)
- doctrine/dbal: ^4.4
- mockery/mockery: ^1.6
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.5|^11.0
README
Laraguard Omega (v1.0) 🛡️💎
The Ultimate Sovereign 2FA Fortress for Laravel
Laraguard Omega is a premier, enterprise-grade Two-Factor Authentication (2FA) suite for Laravel. Re-engineered from the ground up in v1.0, it offers a "Sovereign Security" experience that combines stealth architecture with elite performance.
🏛️ Modern Architecture (The V5 Refactor)
Laraguard v1.0 introduces a modernized, PSR-4 compliant directory structure built for maximum maintainability:
- 🧬
src/Traits: Decoupled, reusable security concerns. - �
src/Providers: High-performance service bootstrapping and discovery. - 🧱
src/Models: Dedicated model layer with specializedConcerns. - ✅ 100% Stability: Verified by 96 rigorous tests and 392 assertions.
🔥 Elite Omega Features
- 🕵️ Stealth Pivot Masking: Automatically shields 2FA relationships from JSON/Array serialization.
- 🌍 Pluggable Geofencing: Interface-based geolocation (MaxMind, IPStack, or custom).
- ⚡ Performance Caching: In-memory status caching for millisecond-speed authentication checks.
- 🔑 Passkeys Ready: Foundational support for FIDO2/WebAuthn biometric keys.
- 📋 Audit Intelligence: Automated event logging for all critical security transitions.
- 🎨 Premium UI: Seamless Filament PHP integration and beautiful Blade components.
🛠️ Installation
composer require skywalker-labs/laraguard
1. Protect Your Models
Add the TwoFactorAuthentication trait to any authenticatable model:
use Skywalker\Laraguard\Traits\TwoFactorAuthentication; class User extends Authenticatable { use TwoFactorAuthentication; }
2. Configure Your Shield
Publish the configuration to customize your security tiers:
php artisan vendor:publish --provider="Skywalker\Laraguard\Providers\LaraguardServiceProvider"
⚡ Quick Usage
Enable 2FA
Confirm the TOTP code from a user's authenticator app to activate protection:
$user->confirmTwoFactorAuth($code);
Emergency Recovery
Generate high-entropy, encrypted recovery codes for absolute resilience:
$user->generateRecoveryCodes();
Trusted Devices
Allow users to "Remember this device" securely with IP-bound, expiring tokens:
if ($user->isSafeDevice($request)) { // High-speed bypass }
🛡️ Enterprise Grade Security
- Triple-Layer Encryption: Shared secrets and recovery codes are never stored in plain text.
- Event-Driven Resilience: Hooks into
TwoFactorEnabled,TwoFactorFailed, and more. - Zero-Config Discovery: Fully compatible with Laravel's package auto-discovery.
Credits & Support
Maintained with ❤️ by Skywalker-Labs.
Lead Architect: Mradul Sharma
Tip
Need custom security integration? Check our Documentation or contact the labs.