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 exception pages so you can generate a link and let teammates view the full error details without screen sharing. Install as a dev dependency and share local exceptions instantly.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Lightweight & Non-Intrusive: The package leverages Laravel’s exception handling middleware without requiring significant architectural changes. It integrates seamlessly with existing error-handling workflows (e.g., App\Exceptions\Handler) and Flare, making it ideal for projects already using Spatie’s ecosystem.
  • Event-Driven: Hooks into Laravel’s exception rendering pipeline, ensuring minimal performance overhead. The package’s core functionality (sharing errors via a UI button) is decoupled from business logic, reducing blast radius.
  • View-Centric: Relies on Blade templates for error display, which may require alignment with existing UI frameworks (e.g., Livewire, Inertia) if custom error pages are in use.

Integration Feasibility

  • Laravel-Specific: Tightly coupled to Laravel’s exception system (e.g., render() method in Handler). Non-Laravel PHP projects or frameworks would need significant refactoring.
  • Flare Dependency: Requires Laravel Flare for full functionality (error storage/sharing). Teams not using Flare would need to implement alternative storage (e.g., database, third-party APM).
  • Dev-Only Scope: Installed as a --dev dependency, which may conflict with production environments where error details should be suppressed (e.g., APP_DEBUG=false).

Technical Risk

  • Laravel Version Lock: While supporting Laravel 12/13, the package may lag behind major releases (e.g., Laravel 14). Risk of deprecation if Laravel’s exception handling changes (e.g., new throwable support).
  • View Compilation Issues: Historical bugs (e.g., PR #15, #17) suggest potential edge cases with Laravel’s view caching or Blade compilation, especially in shared hosting or CI/CD pipelines.
  • Security Implications:
    • Error sharing generates publicly accessible URLs (e.g., https://your-app.test/errors/123). Ensure:
      • URLs are rate-limited or short-lived (e.g., token-based).
      • Sensitive data (e.g., stack traces, request payloads) is sanitized before sharing.
    • Flare integration may expose environment variables or database credentials if not configured securely (e.g., APP_DEBUG=true in production).

Key Questions

  1. Flare Compatibility:
    • Is Flare already in use? If not, what’s the migration path for error storage?
    • Are there cost implications for Flare’s team plan (e.g., error limits, retention)?
  2. Production Readiness:
    • How will error sharing be disabled in production without breaking the package?
    • Are there audit logs for shared errors (e.g., who accessed them, when)?
  3. Customization Needs:
    • Can the share button be styled or repositioned to match the app’s UI?
    • Is there support for custom error fields (e.g., additional context like user IDs)?
  4. Performance:
    • What’s the impact on error rendering time? (Measure with tideways/xhprof or Laravel Debugbar.)
    • Does the package cache error data to avoid repeated Flare API calls?
  5. Alternatives:
    • Would Laravel Telescope or Sentry better fit the team’s observability needs?
    • Is there a self-hosted alternative (e.g., storing errors in a database table)?

Integration Approach

Stack Fit

  • Laravel Ecosystem: Ideal for projects using:
    • Spatie’s Flare (for error storage/sharing).
    • Laravel 12/13 (active support; Laravel 11+ may require backporting).
    • Blade templates (for error views; Inertia/Livewire may need adapters).
  • Non-Laravel Projects: Not suitable without significant refactoring (e.g., rewriting exception handlers).
  • Monolithic vs. Microservices:
    • Monoliths: Easy to integrate via global middleware.
    • Microservices: May require service-specific error handlers or a centralized error-sharing API.

Migration Path

  1. Prerequisites:
    • Install Flare (if not already present):
      composer require spatie/laravel-flare --dev
      
    • Configure Flare in .env:
      FLARE_ID=your-flare-id
      FLARE_SECRET=your-flare-secret
      
  2. Installation:
    composer require spatie/laravel-error-share --dev
    
    • Verify --dev flag aligns with team’s dependency management policies.
  3. Testing:
    • Trigger an error (e.g., abort(500)) and confirm the share button appears.
    • Test sharing with a colleague to validate Flare integration.
  4. Production Safeguards:
    • Disable in production via middleware or environment checks:
      if (!app()->environment('local')) {
          return response()->view('errors.404'); // Bypass error-share
      }
      

Compatibility

  • Laravel Versions:
    • Officially supports 12.x–13.x; test thoroughly on 11.x if needed.
    • Check for breaking changes in Laravel’s ExceptionHandler (e.g., render() method signatures).
  • PHP Versions:
    • Requires PHP 8.1+ (per Laravel 12/13 requirements).
    • Test with HHVM or PHP 8.2+ if using cutting-edge versions.
  • Dependencies:
    • Conflicts unlikely, but audit for:
      • spatie/laravel-flare (required).
      • spatie/laravel-view-modifiers (used for Blade views; may need updates).

Sequencing

  1. Phase 1: Local Development
    • Install in a non-production environment first.
    • Customize error views (e.g., add team-specific branding).
  2. Phase 2: CI/CD Integration
    • Add to test suites (e.g., phpunit tests for error pages).
    • Exclude from production builds (e.g., via composer.json extras).
  3. Phase 3: Monitoring
    • Set up Flare alerts for critical errors.
    • Log error-sharing events (e.g., via Laravel’s log channel).

Operational Impact

Maintenance

  • Dependency Updates:
    • Minor updates (e.g., 1.x → 1.x) are low-risk; major updates require testing.
    • Use composer require spatie/laravel-error-share --dev --update-with-dependencies for patch updates.
  • Flare Maintenance:
    • Monitor Flare’s status page and changelog for breaking changes.
    • Backup Flare data if using self-hosted instances.
  • Custom Code:
    • Overrides (e.g., modified Blade templates) must be version-controlled and tested post-updates.

Support

  • Troubleshooting:
    • Common issues:
      • Share button missing: Verify APP_DEBUG=true and Flare is configured.
      • Blank error pages: Clear Blade cache (php artisan view:clear).
      • Flare not receiving errors: Check storage/logs/flare.log.
    • Debug with:
      php artisan config:clear
      php artisan cache:clear
      
  • Community Resources:
    • GitHub Issues tab for known bugs.
    • Spatie’s documentation and Flare docs.
    • Stack Overflow (tag: spatie-laravel-error-share).

Scaling

  • Performance:
    • Error Sharing: Generating shareable URLs is lightweight, but Flare API calls may add latency. Test under load with:
      artisan queue:work --sleep=3 --tries=1
      
    • Storage: Flare’s cloud tier scales automatically; self-hosted instances may need DB optimization.
  • High Availability:
    • Flare’s replication ensures error data isn’t lost during outages.
    • For air-gapped environments, consider a local fallback (e.g., database storage).

Failure Modes

Failure Scenario Impact Mitigation
Flare API downtime Errors can’t be shared. Fallback to local storage (e.g., DB table).
APP_DEBUG=false in production Share button disappears. Use middleware to conditionally enable/disable.
Blade template compilation errors Error pages break. Test with php artisan view:cache.
Sensitive data in shared errors Security risk. Sanitize payloads (e.g., redact tokens).
Laravel version incompatibility Package fails to
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai