- How do I install and configure spatie/laravel-flare for Laravel 11+?
- Run `composer require spatie/laravel-flare`, then add your Flare API key to `.env` under `FLARE_API_KEY`. No migrations or additional setup are required—just ensure `APP_ENV=production` for error tracking to activate. The package integrates automatically with Laravel’s exception handler.
- Does spatie/laravel-flare work with Laravel 10 or PHP 8.1?
- No, this package is explicitly built for Laravel 11+ and PHP 8.2+. If you’re on an older version, check the Flare documentation for legacy Laravel support or consider upgrading to meet the requirements for full feature compatibility.
- Can I use spatie/laravel-flare alongside spatie/laravel-ignition?
- Yes, they serve different purposes. Use `spatie/laravel-ignition` for polished local error pages during development, while `spatie/laravel-flare` sends production errors to Flare for centralized tracking. They don’t conflict and can coexist in the same project.
- How do I test if errors are being sent to Flare correctly?
- Run `php artisan flare:test` to simulate an error and verify it appears in your Flare dashboard. For integration tests, use Pest/Testbench with the workbench server running. Ensure your `.env` has `FLARE_API_KEY` and `APP_ENV=production` set for accurate testing.
- Will spatie/laravel-flare slow down my production app?
- The package adds minimal overhead (~1–5ms per request) for error tracking. To further optimize, disable telemetry (e.g., performance monitoring) by setting `FLARE_TRACES=false` in `.env`. For high-throughput apps, use `FLARE_SAMPLE_RATE` to sample errors and avoid rate limits.
- Can I customize what data is sent to Flare (e.g., exclude sensitive info)?
- Yes, Flare censors sensitive data (cookies, sessions) by default, but you can further customize collectors via the `flare.collects` config. Audit your custom collectors for PII compliance, especially if extending telemetry for domain-specific metrics like payment failures.
- How do I handle errors for multi-tenant applications in a shared Flare account?
- Use the `FLARE_PROJECT` environment variable to group errors by tenant or project. Alternatively, implement custom logic in your exception handler to dynamically set the project ID based on tenant context before reporting to Flare.
- Does spatie/laravel-flare support Livewire or Octane?
- Yes, the package includes first-party collectors for Livewire (v4+) and Octane performance monitoring. Enable Livewire support with `FLARE_LIVEWIRE=true` in `.env` and test in staging first, as experimental features may require validation in complex apps.
- Can I use spatie/laravel-flare with Vapor or serverless Laravel?
- Yes, the package is optimized for Vapor, handling async queues and serverless edge cases like streamed responses. Ensure your Vapor deployment includes the `FLARE_API_KEY` in environment variables and test error reporting with `flare:test` in a staging environment.
- What are the alternatives to spatie/laravel-flare for error tracking?
- Alternatives include Sentry (cross-stack, but may duplicate Laravel-specific context), Monolog (for logging, not real-time alerts), or New Relic/Datadog (enterprise-grade but heavier). Flare is tailored for Laravel, offering seamless Livewire/Octane integration and a lightweight footprint.