Weave Code
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

Flare Client Php Laravel Package

spatie/flare-client-php

PHP client for sending errors, exceptions, and stack traces to Flare. Install via Composer, configure your API key, and report incidents from any PHP 8.2+ app. For Laravel integrations, use spatie/laravel-flare.

View on GitHub
Deep Wiki
Context7

spatie/flare-client-php is a lightweight PHP client that sends errors, exceptions, and stack traces to Flare for centralized monitoring and debugging. Install via Composer and integrate it into any PHP 8.2+ application to capture actionable crash reports with minimal setup.

If you’re using Laravel, consider spatie/laravel-flare for a framework-tailored integration.

  • Reports exceptions and error traces directly to Flare
  • Compatible with PHP 8.2+ and framework-agnostic
  • Simple Composer installation and configuration
  • Built-in tooling for maintaining quality (tests, static analysis)
Frequently asked questions about Flare Client Php
How do I install spatie/flare-client-php in a Laravel project?
Use Composer to install the package with `composer require spatie/flare-client-php`. For Laravel-specific integrations (like Ignition support), prefer `spatie/laravel-flare` instead. This package is framework-agnostic and works in any PHP 8.2+ app.
What Laravel versions does this package support?
This package is framework-agnostic and works with any Laravel 8.x+ or 9.x+ project. It’s designed for PHP 8.2+, so ensure your Laravel version aligns with that requirement. For deeper Laravel integration (e.g., Ignition), use `spatie/laravel-flare`.
Can I use this package in non-Laravel PHP applications like Symfony or custom CLI scripts?
Yes, this package is explicitly designed for non-Laravel PHP apps. It works seamlessly with Symfony, Lumen, or standalone PHP scripts. The Laravel-specific package (`spatie/laravel-flare`) is only needed for Ignition or framework-tailored features.
How do I configure the API key and send errors to Flare?
Set your Flare API key via environment variables (`FLARE_API_KEY`) or directly in the client configuration. Use `Flare::report($exception)` to send exceptions or `Flare::error($message, $level)` for custom errors. The package auto-detects stack traces and request context.
Does this package support filtering errors (e.g., ignore E_NOTICE or specific exceptions)?
Yes, you can configure error levels via `Flare::setReportErrorLevels()` to filter out specific errors (e.g., `E_NOTICE`). You can also override default behavior for exceptions or custom attributes using the client’s configuration methods.
How does this package handle sensitive data like passwords or API keys in error reports?
The package automatically censors sensitive data in request bodies, cookies, and sessions using wildcard patterns (e.g., `password`, `api_key`). You can extend this with custom censoring rules via `Flare::setCensorCallback()` for application-specific fields.
Can I self-host Flare and use a custom API endpoint with this package?
Yes, the package supports custom API endpoints. Set the `FLARE_API_URL` environment variable or configure it directly in the client to point to your self-hosted Flare instance. This is useful for private or air-gapped deployments.
How does performance impact compare to alternatives like Sentry or Rollbar?
This package is optimized for low overhead, with batched requests and minimal memory usage. Unlike heavier alternatives like Sentry, it avoids global state and focuses solely on error reporting. Benchmarks show negligible latency, making it ideal for production environments.
What testing strategies should I use for error reporting in CI/CD?
Mock the Flare API in tests using HTTP clients like Guzzle or Pest’s mocking tools. Test edge cases like network failures, censoring rules, and custom attributes. The package includes built-in test coverage for core functionality, but validate your specific use case.
Are there alternatives to spatie/flare-client-php for Laravel error monitoring?
For Laravel, consider `spatie/laravel-flare` for deeper integration (e.g., Ignition support). Other alternatives include Sentry (more feature-rich but heavier) or Rollbar (enterprise-focused). This package is lighter and framework-agnostic, ideal if you need simplicity or non-Laravel support.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport