Weave 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

Flare Client Php Laravel Package

spatie/flare-client-php

The PHP client for Flare: capture errors, exceptions, and traces from PHP 8.2+ apps and send them to Flare for debugging. Works standalone or with Laravel via laravel-flare.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: This is the framework-agnostic PHP client for Flare, not the Laravel integration. For a Laravel estate, the intended entry point is spatie/laravel-flare, which pulls this package in and wires service provider, config, and framework hooks. Direct use of flare-client-php is a lower-level choice and is best reserved for non-Laravel PHP services, legacy apps, or custom frameworks where explicit bootstrapping is required. The package fits an architecture where Flare is the selected observability backend for errors, traces, logs, and sampling. The MIT license reduces legal friction, but the backend is commercial SaaS, so the real TCO includes subscription, data egress, procurement, and vendor management. The 3.x line adds OpenTelemetry-style traces/logs, dynamic sampling, queue/job recorders, and a bundled Flare daemon, which maps well to modern Laravel workloads, but may be overkill if the team only needs basic exception aggregation.

Integration feasibility: Composer-based installation is straightforward. PHP baseline is 8.2+ per the README, though the 3.2.0 changelog notes PHP 8.1 support, so the exact composer.json constraint should be verified before committing. Laravel teams should not install this package directly unless they need custom wiring. Direct integration requires bootstrapping Flare, registering error handlers, configuring senders, lifecycle, sampling, and censoring. This is feasible in days for a small platform team, but it is not zero-touch. Version compatibility looks healthy: Guzzle 8 support was added in 3.3.1, Symfony 8 support in 2.5.3, and the package has CI plus PHPStan badges. The main integration risk is not installation but behavioral correctness under error storms, queue workers, and framework-specific middleware.

Technical risk: Medium. The 3.0 release was a breaking rewrite: reportMessage(), sendReportsImmediately(), Flare::reset(), and error solutions were removed; collectLogs() was renamed to collectLogsWithErrors(); addRawSpan() became addSpan(); and Flare accessors became readonly properties. Custom middleware, samplers, and error handlers that touched 2.x APIs will need rework. Vendor lock-in to Flare is the second risk: the client is MIT, but the backend is proprietary and data leaves the application boundary. PII, data residency, retention, and DPA requirements must be cleared before production. Third, the package has only 178 GitHub stars and 0 listed dependents, which is a weak direct-adoption signal, although Spatie’s reputation and Packagist download counts mitigate this. The future-dated release timestamp (2026-09-09) should be checked for provenance/anomaly. Low stars likely understate usage because the package is often installed transitively through the Laravel wrapper.

Key questions: What problem are we solving: error tracking only, or full traces/logs/APM? Is Flare approved by security, legal, and procurement, including DPA, data residency, retention, and PII handling? What are expected monthly event and span volumes, and what sampling policy will keep cost bounded? Do we need self-hosted or OpenTelemetry-native export instead of a proprietary backend? Will we standardize on the Laravel wrapper or use this client directly for non-Laravel services? Who owns project keys, censoring rules, sampling policy, and upgrade cadence? What is the rollback plan if Flare is unavailable or the contract is not renewed? What SLAs and support terms apply? Are cookie, session, request-body, and credential censoring sufficient for our data classification?

Integration Approach

Stack fit: For a Laravel monolith or modular monolith, install spatie/laravel-flare and treat flare-client-php as a transitive dependency. Use this package directly only for non-Laravel PHP services, legacy applications, or custom frameworks where the team wants explicit control over lifecycle, senders, and attribute providers. The PHP 8.2+ baseline aligns with modern Laravel. The client is Composer-only and SaaS-backed, so no infrastructure is required unless the Flare daemon is adopted for local buffering. Guzzle and Symfony version support are broad enough for most current Laravel stacks, but a composer why-not audit is still warranted.

Migration path: Greenfield: install the Laravel wrapper, configure project key/DSN via environment variables, set environment and release metadata, enable sampling, and configure censoring before production. Migrating from another tool: run dual-write in staging, compare error fidelity and trace completeness, then cut over per service. Upgrading 2.x to 3.x: read UPGRADING.md, pin ^3.3, search for removed or renamed APIs, update custom samplers to accept ?bool $parentSampled, replace getter calls with readonly properties, and test job/queue subtask tracing. No database migration is required; config and code paths are the migration surface.

Compatibility: Confirm the actual PHP constraint in composer.json, because the README and changelog disagree on 8.1 vs. 8.2. Guzzle 8 and Symfony 8 are supported in current 3.x releases. Laravel 13 support is noted in the 1.11.0 changelog, but the wrapper version must be matched to the application’s Laravel version. Potential conflicts include other error handlers, existing OpenTelemetry instrumentation, and middleware that assumes 2.x APIs. If the organization already runs an OTel collector, decide whether Flare is the primary backend or a secondary sink to avoid duplicate tracing costs.

Sequencing: First, complete vendor and security approval, including data classification and budget. Second, run a non-production spike with the Laravel wrapper, send a test exception and trace, and verify the flare:test path. Third, review censoring: cookies, sessions, request bodies, and git remote credentials. Fourth, deploy to staging with sampling tuned to projected volume and measure latency, memory, and egress. Fifth, canary one production service and monitor error rate, network failures, and quota consumption. Sixth, expand service by service and document the runbook. If direct client integration is needed for non-Laravel services, replicate lifecycle initialization and shared config standards.

Operational Impact

Maintenance: Vendor-maintained with active releases, changelogs, upgrade notes, CI, and PHPStan. The 3.x line is current, but major-version churn is real: 2.x to 3.x removed and renamed public APIs. Pin minor versions, use Dependabot or Renovate, and allocate capacity for periodic major upgrades. A platform team should own Flare project keys, sampling policy, censoring rules, and upgrade cadence. The code footprint is small when using the Laravel wrapper; direct integration adds custom bootstrapping that the team must maintain. Documentation lives externally at flareapp.io, so internal runbooks should link to it and capture organization-specific configuration.

Support: Commercial support is available through Flare, including security contact via [email protected]. Community support is via GitHub issues and pull requests. Spatie is a reputable Laravel-ecosystem vendor, but no enterprise SLA should be assumed unless purchased. The MIT license provides legal flexibility but not product support. If Flare is unavailable, the application should continue handling errors locally; the client has graceful handling for non-JSON API responses and includes curl fallback when the daemon is unreachable. The TPM should still define an internal escalation path for vendor outages and quota exhaustion.

Scaling: The client is designed for high-volume PHP applications: dynamic sampling per entry point, W3C traceparent-aware sampling, large span attribute trimming to bound memory, and a bundled daemon for routing and buffering. The primary scaling risk is cost and data volume, not client CPU, provided sampling is configured. Error storms can multiply outbound requests, so rate limiting, sampling, and circuit breaking should be configured at the application or daemon layer. Queue and job workloads benefit from subtask mode, which prevents trace explosion but requires correct configuration. Multi-service deployments should use consistent project keys per environment and standardized resource attributes.

Failure modes: Network or DNS failure should fail open and not break the application; verify this in staging. Non-JSON API responses are handled gracefully in 2.10.2. Daemon unreachability falls back to curl. Large payloads and memory pressure are mitigated by span-attribute trimming, but request bodies and log context still need application-level caps. Credential leakage is partly addressed by git remote URL credential stripping, but request-body, cookie, and session censoring must be configured explicitly. Recursion in error handlers is a classic risk and should be tested with synthetic failures. Performance overhead depends on synchronous send behavior; the daemon or queue-based flushing may be needed for latency-sensitive paths.

Ramp-up: Basic installation is low-effort: a Laravel developer can add the wrapper and environment key in under an hour. Full 3.x adoption is moderate: traces, spans, sampling rules, attribute providers, lifecycle, and daemon behavior require one to two days of focused learning. OpenTelemetry concepts such as traceparent, span attributes, and sampling decisions require on-call training. The TPM should plan one sprint for a single Laravel app through staging validation, and two to three sprints for multi-service standardization. Schedule a post-implementation review after the first production error storm or traffic peak to tune sampling, censoring, and cost.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource