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

  • Laravel-Centric: Designed exclusively for Laravel, leveraging its exception handling middleware (App\Exceptions\Handler). Fits seamlessly into Laravel’s error reporting stack (e.g., render(), report() methods).
  • Flare Integration: Requires Laravel Flare (Spatie’s paid tool) for full functionality, limiting standalone utility. Assumes Flare is already deployed or planned.
  • Minimal Overhead: Adds a single Blade view (error-share.blade.php) and a share button to Laravel’s default error page. No database or external API dependencies beyond Flare.
  • Event-Driven: Hooks into Laravel’s illuminate.exception event, ensuring real-time error capture without manual instrumentation.

Integration Feasibility

  • Laravel Version Support: Actively maintained for Laravel 12–13, with explicit fixes for edge cases (e.g., view compilation in >12.29). Backward compatibility with Laravel 11 likely exists but untested.
  • Flare Dependency: Mandatory for error sharing. Requires:
    • Flare’s PHP extension installed.
    • Flare’s Laravel service provider configured (spatie/laravel-flare).
    • A Flare account (free tier available) to receive shared errors.
  • Dev-Only Installation: Installed via --dev, avoiding production bloat. Safe for CI/CD pipelines or local development but not production.

Technical Risk

Risk Area Severity Mitigation Strategy
Flare Dependency High Validate Flare setup pre-integration; test error sharing locally.
Laravel Version Mismatch Medium Pin Laravel version in composer.json to match package support.
View Compilation Issues Low Follow Spatie’s Laravel 12+ fixes.
Security (Error Exposure) Medium Ensure Flare’s IP whitelisting is configured to restrict access.
Performance Impact Low Minimal; only active during error rendering.

Key Questions

  1. Flare Strategy:
    • Is Flare already deployed in your stack? If not, what’s the cost/approval path for adoption?
    • Will you use Flare’s free tier or require enterprise features (e.g., team collaboration)?
  2. Error Handling Workflow:
    • How will shared errors be triaged (e.g., Slack alerts, Jira tickets)? Flare integrates with tools like GitHub/GitLab, but custom workflows may need scripting.
  3. Local vs. Production:
    • Will this be used only in development or also in staging/production (e.g., for critical bug reproduction)?
  4. Customization Needs:
    • Do you need to extend the share button (e.g., add metadata like user ID, request context)?
    • Will the default Blade view suffice, or are custom templates required?
  5. Compliance:
    • Are there data privacy concerns (e.g., PII in error traces)? Flare allows sensitive data redaction—confirm configuration.

Integration Approach

Stack Fit

  • Core Stack: Laravel 12/13 (PHP 8.1+).
  • Dependencies:
    • Required: spatie/laravel-flare (v1.0+), PHP 8.1+.
    • Optional: Blade templating (for custom views), Laravel’s default error pages.
  • Anti-Patterns:
    • Avoid in headless APIs (no error pages to render).
    • Not suitable for non-Laravel PHP projects.

Migration Path

  1. Prerequisite Setup:
    • Install Flare:
      composer require spatie/laravel-flare --dev
      
    • Configure Flare’s .env and service provider (config/app.php).
    • Verify Flare is capturing errors locally (check Flare dashboard).
  2. Package Installation:
    composer require spatie/laravel-error-share --dev
    
    • Publish the view (if customization needed):
      php artisan vendor:publish --tag=error-share-views
      
  3. Testing:
    • Trigger a test error (e.g., abort(500) in a route).
    • Verify the share button appears and Flare receives the error.
  4. Production Readiness:
    • Dev-only: Ensure --dev flag is retained in production.
    • Monitoring: Set up Flare alerts for shared errors (e.g., Slack webhooks).

Compatibility

Component Compatibility Notes
Laravel 12/13 Explicitly supported; active fixes for edge cases.
Laravel 11 Unverified; may work but lacks official support.
Flare v1.0+ Required; older versions may break sharing functionality.
Blade Templating Custom views must extend error-share layout.
CI/CD Safe for pipelines (dev-only); no runtime impact.

Sequencing

  1. Phase 1 (Dev Setup):
    • Install Flare + laravel-error-share in local/dev environments.
    • Test error sharing workflow with team members.
  2. Phase 2 (Staging):
    • Deploy to staging; validate Flare integration (e.g., no missing data in traces).
    • Customize views/templates if needed.
  3. Phase 3 (Production):
    • Optional: Enable in staging/production for critical bug reproduction.
    • Document the share button workflow for support teams.
    • Set up Flare alerts for shared errors (e.g., @error-shared Slack channel).

Operational Impact

Maintenance

  • Package Updates:
    • Minor updates (e.g., Laravel 13 support) are low-risk; follow Spatie’s changelog.
    • Dependency Updates: Monitor spatie/laravel-flare for breaking changes.
  • Customizations:
    • Overriding views requires re-publishing on updates (php artisan vendor:publish).
    • Extending functionality (e.g., adding metadata) may need forking if upstream doesn’t support it.

Support

  • Troubleshooting:
    • Common Issues:
      • Share button missing → Verify App\Exceptions\Handler includes ShareError.
      • Flare not receiving errors → Check Flare’s .env config (APP_URL, FLARE_ID).
      • View compilation errors → Run composer dump-autoload or update Laravel.
    • Debugging Tools:
      • Flare’s local debugging (e.g., php artisan flare:debug).
      • Laravel’s config:clear if view changes aren’t reflecting.
  • Support Channels:
    • GitHub Issues (Spatie’s team responds to bugs).
    • Flare’s documentation for error-sharing specifics.

Scaling

  • Performance:
    • Negligible impact in production (dev-only).
    • In staging/production: Ensure Flare’s rate limits aren’t exceeded (unlikely for error sharing).
  • Error Volume:
    • High-error environments (e.g., APIs with many 5xx responses) may flood Flare.
    • Mitigation: Use Flare’s filtering (e.g., ignore Symfony\Component\HttpKernel\Exception\NotFoundHttpException).

Failure Modes

Failure Scenario Impact Mitigation
Flare service unavailable Share button broken Fallback: Manual error screenshots (e.g., php artisan screenshot).
Laravel version incompatibility Package fails to load Pin Laravel version in composer.json.
View compilation errors Share button non-functional Run composer dump-autoload; check Laravel logs.
Flare misconfiguration Errors not shared Validate .env (FLARE_ID, APP_URL).
Production enablement Accidental error exposure Restrict to staging only; use IP whitelisting in Flare.

Ramp-Up

  • Developer Onboarding:
    • Time to Value: <30 minutes (install + test error sharing).
    • Key Actions:
      1. Install Flare + package.
      2. Trigger an error and click the share button.
      3. Verify Flare dashboard receives the error.
  • Team Adoption:
    • Training: Document the workflow (e.g
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
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