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

Laravel Flare Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Observability-First Fit: 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.
  • Modular Design: The package follows Laravel’s service provider pattern, allowing granular configuration (e.g., log filtering, sampling rules, and sender customization). This makes it non-intrusive and extensible for teams with specific needs (e.g., Vapor, Octane, or Livewire support).
  • OpenTelemetry Compliance: Logs are shipped in OpenTelemetry format, ensuring compatibility with broader observability ecosystems (e.g., Grafana, Prometheus) if Flare’s native integrations are insufficient.

Integration Feasibility

  • Low-Coupling: Requires only:
    1. A Flare API key (.env).
    2. Minimal config updates (config/logging.php, config/flare.php).
    3. Optional: Middleware for custom attribute providers (e.g., request/console metadata).
  • Zero-Downtime: Supports asynchronous sending (via DaemonSender or LaravelHttpSender), reducing latency impact on production.
  • Backward Compatibility: Works with Laravel 11–13, PHP 8.2+, and Vapor/Octane, though some features (e.g., Livewire v4) require explicit opt-in.

Technical Risk

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.

Key Questions for TPM

  1. Observability Strategy:
    • Is Flare the primary tool, or will logs/errors also be sent to Sentry/Datadog? If the latter, how will duplicate data be managed?
  2. Sampling Strategy:
    • Should all errors be captured, or will sampling rules (e.g., by route/queue) be configured to reduce noise?
  3. Compliance:
    • Are there PII/data sensitivity concerns? Flare supports censoring cookies/sessions (v2.6.2+), but custom attribute providers may be needed.
  4. Cost:
    • Flare’s pricing model (per-error/log) could impact high-traffic apps. Will sampling or log level filtering be used to control costs?
  5. Migration Path:
    • If upgrading from Laravel Ignition, will the team adopt Flare’s log-first approach (replacing report() calls with Log::channel('flare'))?

Integration Approach

Stack Fit

  • Laravel-Centric: Optimized for Laravel’s request lifecycle, queue workers, and console commands. Supports:
    • HTTP Requests: Captures routes, headers, payloads, and performance metrics.
    • Queues: Tracks job execution (including Vapor).
    • Logs: Monolog integration with OpenTelemetry format.
    • Livewire: v4 SFC support (v2.7.0+).
    • Octane: Performance monitoring (v2.0.7+).
  • PHP Ecosystem:
    • Requires PHP 8.2+ (no breaking changes for modern stacks).
    • Depends on spatie/flare-client-php (v3.0+), which handles HTTP batching and retry logic.

Migration Path

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

Compatibility

  • Laravel Versions: Tested on 11.47+, 12.42+, and 13. Downgrade support exists for 10.x (v2.x).
  • PHP Extensions: No hard dependencies beyond Laravel’s core.
  • Third-Party Conflicts:
    • Livewire: Explicit v4 support (v2.7.0+).
    • Vapor/Octane: Optimized for async workers (v2.2.4+).
    • PrismPHP: Fixed in v2.2.3 to avoid streaming response issues.

Sequencing

  1. Phase 1 (Core Errors):
    • Enable error reporting to Flare (minimal config).
    • Validate stack traces, request data, and queue jobs.
  2. Phase 2 (Logs & Sampling):
    • Add 'flare' to LOG_STACK; configure log level filtering.
    • Implement sampling rules (e.g., exclude /health).
  3. Phase 3 (Advanced):
    • Custom attribute providers (e.g., user IDs, tenant context).
    • DaemonSender for offline reliability (v3.0+).

Operational Impact

Maintenance

  • Configuration Drift:
    • Risk: config/flare.php may diverge across environments.
    • Mitigation: Use Laravel Envoy or Terraform to manage config as code.
  • Dependency Updates:
    • Risk: spatie/flare-client-php updates may introduce breaking changes.
    • Mitigation: Monitor GitHub releases and test upgrade paths (e.g., v2.x → v3.0).
  • Log Retention:
    • Risk: Flare’s storage limits may require sampling or archiving.
    • Mitigation: Configure minimal_log_level (e.g., debug for dev, error for prod).

Support

  • Debugging Workflow:
    • Pros: Flare provides rich context (requests, logs, traces) in a single UI.
    • Cons: Team must adopt Flare’s UI (training required for non-dev stakeholders).
  • Escalation Path:
    • Flare Support: Limited to paid plans; community support via GitHub Discussions.
    • Self-Hosted: Consider Flare Daemon (v3.0+) for offline reliability.
  • SLA Impact:
    • Error Alerts: Flare’s notification system can integrate with PagerDuty/Opsgenie.
    • Latency: Async senders reduce immediate impact, but batch failures may require monitoring.

Scaling

  • Performance:
    • Overhead: <5ms for error reporting; logs add ~10–50ms depending on volume.
    • Bottlenecks: High log volumes may require sampling or dedicated log channels.
  • Cost Optimization:
    • Sampling: Use DynamicSampler to exclude non-critical routes/jobs.
    • Log Levels: Filter out debug logs in production (minimal_log_level=warning).
  • Horizontal Scaling:
    • Stateless: Works across multi-server Laravel deployments (no shared state).
    • Queue Workers: Ensure Flare senders are resilient to network partitions.

Failure Modes

| Failure Scenario | Impact

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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata