- How do I install spatie/flare-client-php with Composer?
- Run composer require spatie/flare-client-php in your PHP project. The README states a PHP 8.2+ baseline, but the 3.2.0 changelog notes PHP 8.1 support, so verify the exact composer.json constraint before committing. If you are on Laravel, install spatie/laravel-flare instead, which pulls this package in as a transitive dependency.
- Does spatie/flare-client-php work with Laravel?
- Not directly. The Laravel integration is spatie/laravel-flare, which depends on this package and wires the service provider, configuration, and framework hooks for you. Install flare-client-php directly only for non-Laravel PHP services, legacy apps, or custom frameworks where you want explicit control over bootstrapping, senders, and lifecycle. Mixing both approaches usually adds maintenance overhead without benefit.
- How do I send PHP exceptions to Flare without a framework?
- You bootstrap the client yourself: set your Flare project key, register error and exception handlers, and configure the sender and attribute providers. There is no framework magic, so lifecycle, sampling, and censoring rules are your responsibility. Expect a few days of platform-team work to get it production-correct, especially around queue workers and error storms.
- What PHP versions does spatie/flare-client-php support?
- The README says PHP 8.2 and above, while the 3.2.0 changelog notes PHP 8.1 support was added. Check the composer.json constraint for the precise version you install rather than relying on the README or badge alone. Modern Laravel applications will comfortably meet the baseline.
- What changed in spatie/flare-client-php 3.0?
- Version 3.0 was a breaking rewrite: reportMessage(), sendReportsImmediately(), Flare::reset(), and error solutions were removed. collectLogs() became collectLogsWithErrors(), addRawSpan() became addSpan(), and Flare accessors are now readonly properties. Any custom middleware, samplers, or error handlers touching 2.x APIs need rework before upgrading.
- Is spatie/flare-client-php free or does Flare cost money?
- The client package itself is MIT-licensed and free to use, but Flare is a commercial SaaS backend. Real total cost includes the subscription, data egress, procurement, and vendor management, and that should be approved before rollout. The license reduces legal friction on the code, not on the service.
- How do I test that Flare error reporting works in my application?
- The package ships with a test suite you can run via composer test if you are contributing to or patching the client itself. For your own application, exercise an error path in a staging environment with a non-production project key and confirm the event, trace, and censored payload arrive as expected. Check sampling and queue/job recorders specifically, because those are where misconfiguration shows up.
- What are alternatives to spatie/flare-client-php for PHP error tracking?
- Common alternatives include Sentry and Bugsnag, plus OpenTelemetry-native export pipelines if you want to own the backend. Choose based on self-hosting, data residency, retention, and whether you need full traces and APM or just exception aggregation. The Flare client is MIT, but the backend is proprietary, so vendor lock-in is a real consideration.
- Does spatie/flare-client-php support OpenTelemetry traces and logs?
- The 3.x line adds OpenTelemetry-style traces and logs alongside error reporting, plus dynamic sampling and queue/job recorders. It also bundles a Flare daemon, which maps well to modern Laravel workloads. It is not a generic OpenTelemetry exporter to an arbitrary backend, since the destination is Flare, so confirm that fits your observability strategy.
- Is spatie/flare-client-php safe for production and how should I handle PII?
- The client is MIT but the data leaves your application boundary and lands in a proprietary SaaS, so clear PII, data residency, retention, and DPA requirements with security and legal first. Configure censoring for cookies, sessions, request bodies, and credentials and confirm it matches your data classification. Also document a rollback plan in case Flare is unavailable or the contract is not renewed.