backstage/filament-2fa
Adds two-factor authentication to Filament panels. Users enroll via QR code with authenticator apps, confirm with a one-time code, and sign in with TOTP plus recovery codes. Includes setup pages, middleware, and customizable flows for securing your admin panel.
Architecture fit
The package is a thin presentation adapter: Laravel Fortify supplies the headless 2FA backend (TOTP provider, two_factor_secret / two_factor_recovery_codes / two_factor_confirmed_at columns, enable/confirm/disable/recovery-code endpoints), and this package supplies the Filament-facing UI so panel users can enrol, scan a QR code, confirm, and manage recovery codes without pulling in Jetstream or Breeze views. That is a clean fit only when Fortify is already (or is intended to become) the authentication source of truth for the panel's user model. It is a poor fit where Filament panels are bound to bespoke guards or a separate Admin model that Fortify does not know about — Fortify's 2FA endpoints and its TwoFactorAuthenticationProvider are effectively single-provider, and reconciling a multi-guard panel with them is custom work, not configuration.
Integration feasibility
Low code footprint: composer require, register the plugin on the PanelProvider, publish/apply Fortify's 2FA migration, enable two_factor_authentication in config/fortify.php, and ensure FortifyServiceProvider is registered. A competent Laravel developer should reach a working demo in 1–2 days. The real cost is not the install; it is validating the edge cases (confirmation, recovery, disable, session invalidation) and the helpdesk process around lost devices.
Technical risk — overall: medium-high
| Risk | Severity | Notes |
|---|---|---|
| Filament major-version coupling | High | Filament's page/form/plugin APIs changed materially between v3 and v4. The June 2025 release date suggests active maintenance, but pin and verify the actual composer.json constraint before planning. A Filament upgrade can silently strand this package. |
| Feature overlap with native Filament MFA | High (strategic) | Filament ≥3.2 ships first-party multi-factor authentication (app-based + email) that respects the panel's own guard. For greenfield panels, "buy" may mean "use the framework," and this package's value collapses to older Filament versions or teams that specifically need Fortify as the 2FA system of record (e.g., shared 2FA state with an SPA or mobile client). Validate this first — it can kill the initiative cheaply. |
| Guard/provider mismatch | High | Fortify's routes are configured against one guard. Filament's authGuard must align, or users will enrol successfully and still be challenged incorrectly. |
| Bus factor / ecosystem signal | Medium | 69 stars, 0 dependents, single maintainer org. No downstream validation and no commercial support. |
| Security-critical surface | High impact, low likelihood | Recovery-code storage, secret exposure in the QR payload, and session invalidation on enable/disable are correctness-sensitive. A defect here is a security incident, not a UI bug. |
| Route/middleware divergence | Medium | Fortify's password-confirmation and rate-limiting middleware must be reachable from the Filament flow; otherwise enabling 2FA is under-protected. |
Key questions
Stack fit
Assumes a Laravel monolith on the TALL stack with Filament panels and an Eloquent User model on the web guard — the overwhelmingly common case. It is not a fit for token-only API backends, for panels authenticating against an external IdP, or for multi-tenant setups where each tenant has a distinct user provider unless Fortify is reconfigured accordingly.
Migration path
/user/two-factor-* routes versus Filament's /admin/login.Compatibility checklist (verify, don't assume)
PHP and Laravel minor ranges in composer.json; Filament major; two_factor_* columns present and nullable; config/fortify.php features array; cache/session driver suitable for Fortify's rate limiter; QR generation dependency pulled transitively (avoid a GD/Imagick surprise in a slim container image).
Sequencing
Maintenance Budget a recurring line item: one Filament major upgrade per year is the realistic trigger, and the package may lag it. Pin the version, watch the repo's release cadence, and pre-agree a fork-and-patch threshold (e.g., "no compatible release within 30 days of a Filament major"). Do not let this become an unowned transitive dependency in the auth path.
Support No commercial support, no SLA, thin documentation. Internal ownership must be explicit — name a team, not an individual. Operationally, 2FA generates user support load, not system load: lost phones, wiped authenticator apps, exhausted recovery codes. Define and staff a reset procedure (admin-driven reset with identity verification and audit logging) before enforcement, not after the first lockout.
Scaling Technically negligible: TOTP verification is a local HMAC computation; no external calls, no meaningful latency or infrastructure cost. The scaling concern is organisational — helpdesk volume scales with admin headcount at roughly a few percent per quarter, and spikes after any forced-enrolment announcement.
Failure modes
Ramp-up Half a day for a Laravel-fluent engineer to be productive; one to two days to be genuinely safe in the auth path, because the failure modes above are learned from docs-that-don't-exist rather than from the code. Factor onboarding for the helpdesk into the plan as well — they are the ones who will field the recovery calls.
Verdict for planning purposes: conditional adopt. Worth a short spike as a compliance accelerator (satisfies "MFA on administrative access" requirements for SOC 2 / ISO 27001 / cyber-insurance questionnaires that would otherwise cost weeks to build), but only after confirming it is not redundant with Filament's native MFA and only with an explicit fork/exit plan recorded alongside the dependency.
How can I help you explore Laravel packages today?