joe-404/laravel-auth
Config-driven, drop-in auth for Laravel 12/13: JSON API for registration with OTP/magic-link verification, login, refresh tokens, password reset, Google OAuth, multi-session/device fingerprinting, long-lived API tokens, account status workflows, and referrals.
laravel/breeze, laravel/jetstream) with a unified JSON API. This aligns well with API-first Laravel apps or headless backends where auth is decoupled from frontend frameworks..env and config/auth_system.php makes it flexible for different auth flows (e.g., OTP-only, magic-links-only, or hybrid). However, this could lead to configuration sprawl if not managed carefully.User model, running php artisan auth:install). However, existing auth logic (e.g., custom guards, policies) may need refactoring to work with this package’s contracts.| Risk Area | Assessment |
|---|---|
| Dependency Bloat | Auto-installs Sanctum, Socialite, Spatie Permissions, and Reverb—may conflict with existing versions or introduce unnecessary dependencies if not all features are used. |
| Configuration Complexity | ~50+ config options (per docs/configuration.md) can lead to misconfigurations (e.g., OTP vs. magic-link settings, session handling). Requires thorough testing of edge cases (e.g., rate-limiting, failed logins). |
| Migration Overhead | Replacing existing auth (e.g., Breeze, Jetstream) requires: |
User model traits.scheduled_purge_at is auditable and enforceable.Auth Flow Requirements:
Migration Strategy:
Performance & Scaling:
Compliance & Security:
Frontend Impact:
Fallbacks & Resilience:
| Component | Fit Level | Notes |
|---|---|---|
| Laravel 12/13 | ✅ Perfect | Built for Laravel’s latest features (e.g., Reverb, Eloquent 10). |
| PHP 8.2+ | ✅ Required | No flexibility here—must upgrade PHP if using older versions. |
| API-First Apps | ✅ Ideal | JSON-only endpoints work seamlessly with React, Vue, Svelte, or mobile apps. |
| Monolithic Apps | ⚠️ Partial | Blade/Livewire apps may struggle with frontend coupling (e.g., no built-in auth views). Requires custom middleware or redirects. |
| Serverless | ✅ Good | Stateless auth (tokens/sessions) works well with Lambda, Cloud Functions. Redis must be external (e.g., ElastiCache). |
| Microservices | ❌ Poor | Assumes single Laravel instance for sessions/tokens. Distributed auth would require custom session storage (e.g., database-backed). |
| Existing Auth | ⚠️ Refactor | Replaces Laravel’s default auth, Breeze, Jetstream, etc. Custom guards/policies must be rewritten to use the package’s contracts. |
Pre-Migration:
users, password_resets, and related tables.Parallel Phase (Optional):
AUTH_MODE config).Cutover:
composer require joe-404/laravel-auth and php artisan auth:install.User model with required traits (HasApiTokens, HasRoles, SoftDeletes, HasAccountStatus).bcrypt should work, but test)./auth/login instead of /login).Post-Migration:
| Feature | Compatibility | Notes |
|---|---|---|
| **L |
How can I help you explore Laravel packages today?