mindscape/raygun4php
Raygun4PHP is a PHP client for Raygun error tracking. It captures exceptions and errors, sends stack traces, tags, custom data, and user context, and works with Laravel or plain PHP apps to provide real-time crash reporting and diagnostics.
Architecture fit. mindscape/raygun4php is the vendor's first-party, framework-agnostic PHP client for the Raygun error-monitoring SaaS. It is a thin transport + serialization layer: instantiate a RaygunClient with an API key, then push exceptions, errors, and tagged/custom payloads to Raygun's ingest API over HTTPS. There is no Laravel service provider, no facade, and no config publishing — the package is a library, not a Laravel package. That is actually a reasonable architectural fit: it keeps the dependency at the edge of the app (the exception handler and a small service provider), with no framework coupling, no middleware, and no opinion about how you structure your code. The TPM framing is therefore "buy a monitoring backend, glue it in with ~50 lines of bootstrap code" rather than "adopt a framework integration."
Integration feasibility. High. Composer install, a singleton binding, an env-driven API key, and a call from App\Exceptions\Handler::report() (or a global middleware) gets you coverage. The client supports user context, tags, custom data, and version stamping, which is enough to triage the vast majority of production incidents. Manual instrumentation is required for anything beyond uncaught exceptions — job failures, queue worker crashes, and console commands need explicit reporting. The absence of Laravel package auto-discovery means the integration is explicit and auditable, which is a plus for a platform team.
Technical risk. Low code risk, moderate supply-chain/strategic risk. The library is small and single-purpose; the failure mode of the SDK itself is bounded. The real risks are: (1) vendor concentration — Raygun is the only backend, and pricing, data residency, and retention are contractual, not technical, decisions; (2) maintenance signal — 36 stars and zero dependents is thin community evidence, and the release metadata is unusual (a 2026-10-23 timestamp), so release cadence and PHP-version support must be verified directly on Packagist rather than inferred; (3) ecosystem gravity — Sentry and Bugsnag have deeper Laravel integrations, larger communities, and richer first-party tooling, so choosing Raygun is a deliberate platform bet, not a default. None of these are blockers; they are decision inputs.
Key questions.
Stack fit. The package slots in cleanly alongside a standard Laravel stack as an observability sink, not a framework dependency. Recommended shape: a RaygunServiceProvider that registers a configured RaygunClient singleton, an App\Exceptions\Handler override that calls report() on the client in addition to (or instead of) the default logger, a small middleware or terminable middleware that attaches the authenticated user and request correlation ID, and an explicit report call in the queue job failure path. Keep the SDK behind a one-method internal interface (e.g., ErrorReporter::report()) so the vendor can be swapped without touching call sites.
Migration path. Run in shadow mode first: report to Raygun while keeping existing logging/APM intact, and compare captured-error volume and grouping quality for two to four weeks. If Raygun is replacing an incumbent (Sentry, Bugsnag, or log-based alerting), migrate the alert routing only after parity on error grouping is demonstrated, and do not remove the incumbent until the team has triaged real incidents using Raygun alone at least twice.
Compatibility. Verify the Composer constraint against the actual PHP runtime matrix across the fleet — mixed-version estates are the most common source of "works in CI, fails on the legacy service" surprises. Confirm the curl extension is present in every runtime image (containers, FPM, CLI, queue workers). Watch for double-reporting if another error handler is registered: multiple handlers compete, and ordering determines who wins. Confirm there is no conflict with existing set_error_handler/set_exception_handler consumers.
Sequencing.
Maintenance. The ongoing cost is low but non-zero: pin the version, subscribe to releases, and schedule a quarterly review of the constraint against the PHP upgrade calendar. The integration code (provider + handler + interface) is small enough to be owned by one engineer as a side responsibility. Budget for the Raygun subscription itself as a recurring vendor line item with a defined review point.
Support. Support flows to the vendor. The GitHub issue tracker is low-traffic, which cuts both ways — no noisy community, but also limited peer troubleshooting. Establish a named vendor contact and an escalation path before production dependence; treat the vendor as the tier-2 for SDK defects and the internal platform team as tier-1 for configuration.
Scaling. The client transmits per-event over HTTP; at high error volume this becomes both a latency concern (if synchronous) and a cost concern (per-event pricing). Enable any available asynchronous/batched sending, apply sampling or rate limiting on noisy exception classes, and be explicit about what "capture everything" costs at peak traffic and during an incident storm — error monitors are most valuable exactly when volume spikes. Under Octane or long-running workers, validate that the client does not accumulate per-request state across jobs.
Failure modes. Enumerate and test these: API key missing or rotated → silent loss of visibility; Raygun unreachable → must fail open with bounded timeout, never block the request; handler recursion → the client's own failure must not re-enter error reporting; swallowed fatal errors → shutdown-time errors need explicit handling; and misconfigured filtering → sensitive data leaving the perimeter. Each deserves a runbook entry and a synthetic test in staging.
Ramp-up. A competent Laravel engineer should reach working integration in half a day and production-ready integration in two to three days, with the majority of that time spent on filtering, context enrichment, and alert routing rather than on the SDK. Onboarding documentation should be written internally — do not depend on the upstream README as the team's source of truth — and should cover the shared interface, the env vars, the filtering policy, and the "what to do when Raygun is down" procedure.
How can I help you explore Laravel packages today?