yorcreative/laravel-query-watcher
Laravel Query Watcher monitors your application's database queries and flags slow or problematic SQL. Configure thresholds to log warnings or trigger notifications, making it easier to catch performance issues early during development and production.
Architecture fit. v1.4.1 is an additive change: it introduces an HTTP endpoint that authorizes a Pusher client to subscribe to a private channel associated with a query event. This is the standard Laravel broadcasting pattern — a server-side authorization callback (Broadcast::channel or an equivalent controller) that signs the Pusher subscription request after validating the authenticated user. It slots into the existing request/middleware stack rather than introducing a new runtime, queue worker, or storage dependency. For a Laravel application already using Pusher Channels (or a Pusher-protocol-compatible server such as Laravel Reverb/soketi), this is architecturally unremarkable, which is the desirable outcome.
Integration feasibility. High, on the assumption the package already ships broadcasting configuration. The work is: bump the dependency to ^1.4, publish/verify any new route or config stub, and confirm the route is registered under the correct middleware group (auth, and CSRF handling appropriate to the client — Echo sends the XSRF token for same-origin, but cross-origin SPAs need explicit consideration). There is no schema migration implied. The patch version number signals the maintainer considers this backwards compatible; that is a claim to verify, not accept.
Technical risk. The risk is concentrated in one place: authorization correctness. A private channel endpoint is a data-access boundary. If the authorization predicate does not scope the query event to the requesting user (or their tenant/team), any authenticated user who guesses or observes a channel name can subscribe and receive another party's event payloads. Secondary risks: channel naming convention mismatch between the server's authorization response and the client's private- prefix handling, which produces silent non-delivery rather than an error; and coupling to the Pusher auth signature format, which constrains future migration to Reverb/soketi.
Key questions.
pusher/pusher-php-server version constraints?Stack fit. Fits any Laravel application using the Pusher broadcast driver and Laravel Echo on the client. Applications on the log or null broadcast driver are unaffected — the endpoint exists but is never exercised. Front-end frameworks are irrelevant beyond their Echo/CSRF handling.
Migration path. Dependency bump only; no data migration. If the package auto-registers the route, the migration is a deploy-and-configure. If the route must be published or enabled via config flag, treat that as a deliberate opt-in step so the endpoint is not live by default in lower environments with shared credentials. Pin to ~1.4.1 rather than floating, given the security sensitivity.
Compatibility. Confirm three things before merging: Laravel major version support against our current runtime; Pusher SDK version alignment with our existing broadcasting.php configuration; and whether the endpoint expects the standard socket_id/channel_name query parameters that Echo sends. A mismatch on the last point manifests as a 400 at subscribe time, not at deploy time — verify in staging with a real client.
Sequencing.
Maintenance. Low ongoing cost, but this is an auth surface and should be owned explicitly rather than absorbed silently. Add it to the dependency watchlist and re-review on every minor bump, not just majors. Upstream changes to channel naming conventions would be breaking for clients and are the main thing to track.
Support. Expect a new class of support tickets: subscriptions failing with 403 or 401. The common causes are stale CSRF tokens in SPAs, session/auth middleware mismatch on the new route, and Pusher credential misconfiguration in an environment. Pre-empt this with a runbook entry mapping symptom to cause; the 403-vs-silent-no-events distinction is the highest-value diagnostic.
Scaling. Each subscription attempt is one additional authenticated HTTP request. At high concurrent-connection counts this is a real but modest load on the web tier; it does not touch the database beyond whatever the ownership check requires, which should be indexed. If the authorization predicate performs an expensive query, cache the decision briefly keyed by user and channel. Pusher-side connection and channel limits, not this endpoint, will be the binding constraint at scale.
Failure modes. Ranked by severity: (1) permissive authorization predicate — cross-tenant data exposure, silent and hard to detect, mitigated only by the negative test above; (2) channel name mismatch — events silently never arrive, presenting as a product bug rather than an infrastructure one; (3) missing or wrong Pusher credentials — 500 on every subscribe, loud and immediately visible; (4) CSRF/middleware misconfiguration — 403s for legitimate users, visible but noisy in support. Modes 1 and 2 are the ones worth engineering time; 3 and 4 are configuration hygiene.
Ramp-up. Minimal. A Laravel developer familiar with broadcasting can adopt and reason about this in under a day. The knowledge that must be written down rather than assumed is the channel naming contract and the authorization rule — without those two documented, the next engineer to touch this endpoint cannot safely modify it. Recommend a short ADR capturing both, plus the decision to stay on the Pusher protocol versus a migration to Reverb.
How can I help you explore Laravel packages today?