aporat/laravel-firebase-app-check
Laravel integration for Firebase App Check, helping protect your backend from abuse by verifying requests from legitimate app clients. Adds configuration and middleware for validating App Check tokens on incoming requests.
firebase-app-check:soft available per route. This is the feature that makes the adoption decision reversible: you can ship attestation in observe-only mode, watch reportUsing() telemetry for false positives, then tighten route-by-route. A package without a soft mode forces a flag-day cutover — a much harder sell.resolveProjectUsing(). If the roadmap includes additional apps, white-label clients, or regional Firebase projects, that's a config change rather than a fork — a meaningful de-risk for a platform strategy.IdTokenVerifier + Identity cover the "my Laravel API needs to trust a Firebase-signed-in user" case, with InvalidIdToken / IdTokenVerificationFailed giving you distinguishable 401-vs-503 handling. This can remove custom JWT-verification code from the roadmap entirely, or let you scope it down to session/refresh concerns only.AppCheck::fake() and IdTokenVerifier::fake() with recorded verifications and assertions mean CI doesn't need real Firebase credentials or network egress — it removes the most common reason teams quietly skip testing protected endpoints.skipWhen() for webhooks, health checks and server-to-server calls, plus rejectUsing() / reportUsing() hooks for custom logging and metrics, are the seams you need to answer "what do we do when a legitimate client gets rejected?" before it happens.Adopt when most of these hold:
Look elsewhere — or build/spike first — when:
To executives: This is a small, low-cost addition that lets us turn on client attestation for our Firebase-backed apps without a flag-day migration. Because it ships with a soft/observe-only mode, we can measure false-positive impact on real users before enforcing, and roll out route-by-route. It replaces work we'd otherwise have to build and maintain ourselves (Google key rotation, token validation, caching) and gives us a defensible answer to "how do we know requests are coming from our apps?" It's not a silver bullet against determined attackers — it raises the cost of casual abuse and buys us the data to justify the next investment. Main caveat: this is a 0.1.0 release, so we pin the version, isolate it behind our own middleware/config, and expect to review upgrades.
To engineering: Thin middleware, sensible defaults (soft on reads, hard elsewhere, overridable per route), per-project verdict caching bounded by token expiry so we're not calling Google on every request, and outages deliberately not cached so a transient failure doesn't pin a bad verdict. Multi-project via named projects and aliases with resolveProjectUsing() means no branching for future apps; credentials accept a path, JSON string, or array so it fits our secret-management choice. skipWhen() handles webhooks and health checks; rejectUsing() and reportUsing() are the hooks for our logging and metrics. AppCheck::fake() and IdTokenVerifier::fake() with assertions mean protected endpoints stay testable in CI with zero Firebase egress. Two things to nail down in the spike: the failure mode when Google's key endpoint is unreachable (fail-open vs. fail-closed per route), and how we surface rejected-client telemetry before we move anything off soft mode.
How can I help you explore Laravel packages today?