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 Error Share Laravel Package

spatie/laravel-error-share

Adds a “Share” button to Laravel’s local error pages so you can generate a link and send the full exception details to a colleague for quick debugging help. Dev-only install via Composer; no setup needed.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Monolithic/Modular Fit: Ideal for Laravel-based applications (monolithic or modular) where centralized error handling and debugging are critical. Integrates seamlessly with Laravel’s exception handling pipeline via App\Exceptions\Handler.
  • Microservices Fit: Less suitable for microservices unless errors are aggregated via a shared logging layer (e.g., Flare’s centralized dashboard). Requires explicit configuration to forward errors to Flare.
  • Event-Driven Fit: Leverages Laravel’s event system (ErrorShared event) for extensibility, enabling custom logic (e.g., filtering, enrichment) before sharing.

Integration Feasibility

  • Low-Coupling: Minimal invasive changes; hooks into Laravel’s existing exception handling. No database schema changes required.
  • Flare Dependency: Tightly coupled to Spatie’s Flare for storage/visualization. Requires Flare setup (self-hosted or cloud) to function.
  • Customization: Supports overriding default behavior via service provider bindings (e.g., ErrorShare::share()).

Technical Risk

  • Flare Reliability: Risk of downtime if Flare’s API/self-hosted instance is unavailable. Errors may silently fail or require fallback mechanisms.
  • Data Privacy: Sensitive error details (stack traces, request payloads) are sent to Flare. Ensure compliance with GDPR/other regulations (e.g., anonymization, access controls).
  • Performance Impact: Minimal overhead for error sharing, but network calls to Flare could introduce latency in edge cases (e.g., high-error-volume spikes).
  • Version Lock: Flare compatibility is critical; mismatched versions may break functionality (e.g., API changes).

Key Questions

  1. Flare Infrastructure:
    • Is Flare self-hosted or cloud-based? What are the SLAs for uptime/availability?
    • Are there fallback mechanisms (e.g., local logging) if Flare is unreachable?
  2. Data Sensitivity:
    • How are PII (Personally Identifiable Information) or sensitive data handled in error payloads?
    • Are there plans to implement redaction or masking for production environments?
  3. Scalability:
    • What is the expected volume of errors? Could high traffic overwhelm Flare’s API?
    • Are there rate-limiting or batching strategies in place?
  4. Monitoring:
    • How will success/failure of error sharing be monitored (e.g., metrics, alerts)?
    • Are there plans to integrate with existing observability tools (e.g., Datadog, Sentry)?
  5. Customization Needs:
    • Are there specific error types (e.g., 404s, 500s) that should not be shared?
    • Will custom error metadata (e.g., user IDs, session data) need to be attached?

Integration Approach

Stack Fit

  • Laravel Ecosystem: Native support for Laravel 8.x–11.x (as of 2026). Compatible with:
    • Laravel’s exception handler (App\Exceptions\Handler).
    • Flare’s PHP SDK for error ingestion.
    • Common logging libraries (e.g., Monolog) if extended.
  • Non-Laravel Stacks: Not applicable; hard dependency on Laravel’s framework components.
  • Hybrid Architectures: For non-Laravel services, errors would need to be manually forwarded to Flare via its API.

Migration Path

  1. Prerequisites:
    • Install Flare (self-hosted or cloud): composer require spatie/laravel-flare.
    • Configure Flare’s config/flare.php (e.g., API token, environment filtering).
  2. Installation:
    • Add the package: composer require spatie/laravel-error-share.
    • Publish config: php artisan vendor:publish --provider="Spatie\ErrorShare\ErrorShareServiceProvider".
  3. Configuration:
    • Update config/error-share.php to define:
      • Flare project ID/token.
      • Environments to include (e.g., ['local', 'staging']).
      • Custom error metadata (e.g., ['user_id']).
    • Bind custom logic in App\Providers\ErrorShareServiceProvider if needed.
  4. Testing:
    • Trigger a test error (e.g., abort(500)) and verify it appears in Flare.
    • Validate payload structure (e.g., stack traces, request data).

Compatibility

  • Laravel Versions: Explicitly tested for Laravel 8–11. Backward compatibility may require adjustments for older versions.
  • PHP Versions: Requires PHP 8.0+. Check for compatibility if using PHP 7.x.
  • Flare Version: Must align with Flare’s API expectations (e.g., error payload schema). Pin versions in composer.json to avoid surprises.
  • Custom Exceptions: Works with Laravel’s base exceptions. Custom exceptions may need to implement ShouldBeShared or override toErrorShareData().

Sequencing

  1. Phase 1: Core Integration
    • Install and configure Flare + laravel-error-share.
    • Test in a non-production environment (e.g., local, staging).
  2. Phase 2: Customization
    • Extend error sharing logic (e.g., filtering, enrichment).
    • Implement fallback mechanisms (e.g., log to disk if Flare fails).
  3. Phase 3: Production Rollout
    • Gradually enable in production environments.
    • Monitor Flare’s API health and error volume.
  4. Phase 4: Monitoring & Optimization
    • Set up alerts for sharing failures.
    • Optimize payload size (e.g., exclude large request payloads in production).

Operational Impact

Maintenance

  • Package Updates:
    • Monitor Spatie’s release cycle for breaking changes (e.g., Flare API updates).
    • Test updates in staging before production deployment.
  • Dependency Management:
    • Flare updates may require laravel-error-share updates. Use composer why-not to identify conflicts.
  • Configuration Drift:
    • Centralize config/error-share.php and config/flare.php in a shared config repository if using multiple environments.

Support

  • Debugging Workflow:
    • Pros: Reduces context-switching for developers (no need for screen sharing).
    • Cons: Flare dependency adds a single point of failure. Ensure support team has access to Flare’s dashboard.
  • Troubleshooting:
    • Common issues:
      • Flare API unreachable → Check network/firewall rules.
      • Missing errors → Verify App\Exceptions\Handler includes ErrorShare::share().
      • Incomplete payloads → Ensure custom metadata is correctly formatted.
    • Log sharing failures locally (e.g., Monolog) for offline debugging.

Scaling

  • Error Volume:
    • Flare’s cloud tier has limits (check pricing). Self-hosted may require scaling Flare’s database.
    • Consider sampling errors in production (e.g., share only 500 errors).
  • Performance:
    • Network latency to Flare’s API could impact response times for error pages. Test under load.
    • Use async queues (e.g., Laravel Queues) to defer sharing non-critical errors.
  • Multi-Region Deployments:
    • Self-hosted Flare should be deployed close to error sources to minimize latency.

Failure Modes

Failure Scenario Impact Mitigation
Flare API downtime Errors not shared; debugging hindered Fallback to local logging + alerts.
Network partition Errors not reach Flare Queue errors locally; retry on recovery.
Flare rate limits exceeded Errors dropped Implement exponential backoff or sampling.
Corrupted error payload Incomplete data in Flare Validate payloads before sending.
GDPR compliance violation Sensitive data exposed Redact PII in production; audit payloads.

Ramp-Up

  • Developer Onboarding:
    • Document how to:
      • Trigger error sharing (e.g., abort(500)).
      • Access shared errors in Flare.
      • Customize shared data (e.g., adding user_id).
    • Provide a Flare dashboard tour for non-technical stakeholders.
  • Training:
    • For Engineers: Focus on customization (e.g., filtering, metadata).
    • For Ops: Emphasize monitoring Flare’s health and error volume.
  • Change Management:
    • Communicate the shift from ad-hoc debugging (e.g., screen sharing) to Flare-based collaboration.
    • Highlight benefits (e.g., faster debugging, centralized logs) and trade-offs (e.g., Flare dependency).
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