spatie/laravel-flare
Send Laravel 11+ production errors to Flare with a valid API key. Track exceptions, get notified when issues happen, and share error reports publicly when needed. Works on PHP 8.2+ and integrates seamlessly with your app’s reporting.
spatie/laravel-flare is a dedicated observability solution for Laravel, designed to integrate seamlessly with Flare, a SaaS-based error and log monitoring tool. It aligns perfectly with modern Laravel architectures (v11+) that prioritize real-time debugging, performance tracing, and log aggregation..env).config/logging.php, config/flare.php).DaemonSender or LaravelHttpSender), reducing latency impact on production.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| API Key Exposure | High | Use .env with env() helpers; restrict Flare key to production-only environments. |
| Performance Overhead | Medium | Configure sampling rules (e.g., exclude /health routes) and log level filtering. |
| Breaking Changes | Medium | v3.0+ removes reportMessage(); migrate to log channel ('flare'). |
| Vendor Lock-in | Low | Flare’s OpenTelemetry format allows export to other tools (e.g., Datadog). |
| Livewire/Octane Edge Cases | Low | Test with Livewire v4 and Octane workloads; use flare:test command for validation. |
report() calls with Log::channel('flare'))?spatie/flare-client-php (v3.0+), which handles HTTP batching and retry logic.| Step | Action | Tools/Commands |
|---|---|---|
| Prep | Review current error logging (e.g., Sentry, Monolog). | config/app.php |
| Install | Add package and config: composer require spatie/laravel-flare. |
php artisan flare:install |
| Configure | Set FLARE_API_KEY in .env; update config/logging.php to include 'flare'. |
config/flare.php |
| Test Locally | Trigger errors/logs; verify Flare dashboard. | php artisan flare:test |
| Sampling Rules | Define dynamic sampling (e.g., exclude /api/webhooks). |
config/flare.php |
| Production Rollout | Deploy with feature flag (e.g., FLARE_ENABLED=true). |
CI/CD pipeline |
| Monitor | Validate error rates, log volume, and performance impact. | Flare Dashboard |
'flare' to LOG_STACK; configure log level filtering./health).config/flare.php may diverge across environments.spatie/flare-client-php updates may introduce breaking changes.minimal_log_level (e.g., debug for dev, error for prod).DynamicSampler to exclude non-critical routes/jobs.debug logs in production (minimal_log_level=warning).| Failure Scenario | Impact
How can I help you explore Laravel packages today?