Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Auth Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Monolithic vs. Modular: The package is a highly cohesive, modular auth system that replaces Laravel’s built-in auth (e.g., 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.
  • Laravel 13 Compatibility: Built for Laravel 13, but supports 12+. Leverages Laravel’s ecosystem (Sanctum, Socialite, Spatie Permissions) without reinventing core auth logic.
  • Config-Driven: Heavy reliance on .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.
  • Real-Time Features: Integrates with Reverb (Laravel’s real-time server) for live verification events, which is useful for SPAs or real-time dashboards but adds complexity if Reverb isn’t already in use.

Integration Feasibility

  • Drop-in Replacement: Designed to replace Laravel’s default auth with minimal code changes (e.g., adding traits to 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.
  • API-Centric: All auth flows are JSON API endpoints, which is ideal for:
    • Mobile apps (native iOS/Android clients).
    • SPAs (React, Vue, Svelte).
    • Serverless backends (Lambda, Cloud Functions).
  • Frontend Agnostic: No coupling to Blade, Livewire, or Inertia—pure REST/JSON, which simplifies frontend integration but requires manual UI implementation (e.g., OTP input forms, magic-link handling).

Technical Risk

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:
  • Updating User model traits.
  • Rewriting custom auth logic (e.g., guards, policies) to use the package’s contracts.
  • Handling data migration (e.g., existing users, roles, permissions).
  • Downtime if swapping mid-deployment. | | Performance | Redis dependency for sessions/tokens is mandatory. Heavy use of OTP/magic-links could increase email/SMS load and require rate-limiting to prevent abuse. Real-time Reverb events add network overhead. | | Security | - Account deletion grace period (30 days) introduces compliance risks (e.g., GDPR right to erasure). Must ensure scheduled_purge_at is auditable and enforceable.
  • Social OAuth (Google) requires secure callback handling and CSRF protection.
  • Token rotation (refresh tokens) must be properly secured to avoid leaks. | | Long-Term Maintenance | - Single maintainer (judging by GitHub stars/activity). Risk of abandonware if development stalls.
  • Laravel 13+ only (PHP 8.2+). May require backporting for older stacks.
  • Customization limits: While extensible via contracts, deep customization (e.g., non-email logins) may require forking the package. |

Key Questions for TPM

  1. Auth Flow Requirements:

    • Does the team need OTP-only, magic-links-only, or hybrid? This affects config and frontend UX.
    • Are social logins (Google) a must-have, or can they be added later?
    • Is real-time verification (Reverb) critical, or can it be replaced with polling/webhooks?
  2. Migration Strategy:

    • How will existing users/roles/permissions be migrated? Will a data script be needed?
    • Can the package coexist with current auth during a phased rollout, or is a big-bang swap required?
  3. Performance & Scaling:

    • What are the expected user volumes? Will Redis handle session/token load?
    • Are email/SMS gateways (e.g., Twilio, Postmark) already integrated, or will this add latency?
  4. Compliance & Security:

    • How will account deletion grace periods align with GDPR/CCPA requirements?
    • Are admin audit logs (e.g., user status changes) sufficient, or does the team need custom logging?
  5. Frontend Impact:

    • Will the frontend team need new SDKs or can existing auth logic be adapted?
    • How will OTP/magic-link flows be handled in the UI (e.g., modal vs. redirect)?
  6. Fallbacks & Resilience:

    • What happens if email/SMS delivery fails during OTP/magic-link flows?
    • Are there graceful degradation paths for failed logins or rate-limited requests?

Integration Approach

Stack Fit

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.

Migration Path

  1. Pre-Migration:

    • Audit current auth: Document all custom logic (guards, policies, events, middleware).
    • Backup data: Export users, password_resets, and related tables.
    • Test compatibility: Verify the package works with existing Laravel versions (e.g., 12 vs. 13).
  2. Parallel Phase (Optional):

    • Install the package in a staging environment alongside current auth.
    • Route a subset of users to the new auth system (e.g., via AUTH_MODE config).
    • Test data consistency (e.g., logins, role assignments).
  3. Cutover:

    • Run composer require joe-404/laravel-auth and php artisan auth:install.
    • Update User model with required traits (HasApiTokens, HasRoles, SoftDeletes, HasAccountStatus).
    • Migrate data:
      • Seed initial users/roles via a script.
      • Handle existing password hashes (Laravel’s bcrypt should work, but test).
    • Update frontend: Replace auth API calls with the new endpoints (e.g., /auth/login instead of /login).
    • Deploy in stages: Start with non-critical paths (e.g., registration), then expand.
  4. Post-Migration:

    • Monitor logs for auth failures (e.g., token issues, OTP errors).
    • Load test under peak traffic to validate Redis/session performance.
    • Phase out old auth once all paths are migrated.

Compatibility

Feature Compatibility Notes
**L
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor