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.
App\Exceptions\Handler) and Flare, making it ideal for projects already using Spatie’s ecosystem.render() method in Handler). Non-Laravel PHP projects or frameworks would need significant refactoring.--dev dependency, which may conflict with production environments where error details should be suppressed (e.g., APP_DEBUG=false).throwable support).https://your-app.test/errors/123). Ensure:
APP_DEBUG=true in production).tideways/xhprof or Laravel Debugbar.)composer require spatie/laravel-flare --dev
.env:
FLARE_ID=your-flare-id
FLARE_SECRET=your-flare-secret
composer require spatie/laravel-error-share --dev
--dev flag aligns with team’s dependency management policies.abort(500)) and confirm the share button appears.if (!app()->environment('local')) {
return response()->view('errors.404'); // Bypass error-share
}
ExceptionHandler (e.g., render() method signatures).spatie/laravel-flare (required).spatie/laravel-view-modifiers (used for Blade views; may need updates).phpunit tests for error pages).composer.json extras).log channel).1.x → 1.x) are low-risk; major updates require testing.composer require spatie/laravel-error-share --dev --update-with-dependencies for patch updates.APP_DEBUG=true and Flare is configured.php artisan view:clear).storage/logs/flare.log.php artisan config:clear
php artisan cache:clear
spatie-laravel-error-share).artisan queue:work --sleep=3 --tries=1
| 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 |
How can I help you explore Laravel packages today?