facade/flare-client-php
PHP client for Flare error reporting, powering Ignition in Laravel. Captures and sends exceptions, logs, and context to Flare with Laravel integration, middleware, and configurable transport—helping you debug production issues faster.
App\Exceptions\Handler) and service container.guzzlehttp/guzzle for HTTP requests), reducing bloat. Follows a facade pattern for simplicity.report() method).Flare::capture() in HandleIncomingRequest)..env or programmatic API key/endpoint setup, aligning with Laravel’s 12-factor principles.throw_if vs. report())?debugbar, telescope) or third-party APMs (Sentry, Rollbar).App\Exceptions\Handler::report() to forward exceptions to Flare.FlareMiddleware) to capture breadcrumbs for all requests.Log::channel('flare') for log forwarding (if supported).set_exception_handler) or use a PSR-15 middleware adapter.Flare::capture() in critical paths (e.g., CLI jobs).composer require facade/flare-client-php..env:
FLARE_API_KEY=your_key
FLARE_ENDPOINT=https://your-flare-endpoint.com
500 errors).report() in App\Exceptions\Handler:
public function report(Throwable $exception) {
if (app()->environment('production')) {
Flare::report($exception);
}
parent::report($exception);
}
Flare::capture('User clicked "Submit"', ['user_id' => auth()->id()]);
tideways-xhprof profiling).php -v and laravel/framework version constraints in composer.json.Flare::context(['custom_data' => $model->toArray()])).composer.json to avoid auto-updates (risky due to lack of recent releases)..env keys (e.g., AWS Secrets Manager) to avoid hardcoding.config/flare.php for environment-specific settings.storage/logs/laravel.log).curl -v https://flare-endpoint.com).Log::critical($exception)).Flare::later()->report($e)).Flare::throttle(60)).5xx errors).| Scenario | Impact | Mitigation |
|---|---|---|
| Flare API downtime | Lost error context | Local fallback logging |
| Network partition | Unreported errors | Queue reports for retry |
| Invalid API key | Silent failures | Validate key on startup |
| PHP version incompatibility | Integration breaks | Fork/package patch |
| Data privacy violation | Compliance risk | Redact PII; restrict to non-sensitive envs |
Flare::report() and breadcrumbs.5xx errors in Flare).How can I help you explore Laravel packages today?