Sentry for Laravel
Official Sentry SDK for Laravel with automatic error, log, and performance tracing capture
Repository Health
Technical Analysis
Sentry for Laravel is the official first-party SDK that wires Sentry’s error monitoring, log capture, and performance/tracing instrumentation into a Laravel application with minimal setup. Installing the package and registering Integration::handles($exceptions) in bootstrap/app.php automatically reports unhandled exceptions, and the SDK can additionally be configured as a Laravel log channel to capture info/debug level logs alongside errors.
Built on top of sentry/sentry, the underlying PHP SDK, this package adds Laravel-specific integrations: a service provider, event handler, console command (sentry:publish) for scaffolding configuration, HTTP/job/log tracing integrations, and feature flags for enabling specific instrumentation. It supports every actively maintained Laravel version from 6.x through 13.x, with version-gated compatibility documented explicitly in the README for older Laravel and Lumen releases.
What You Get
- Automatic unhandled-exception capture via
Integration::handles($exceptions)inbootstrap/app.php - A Laravel log-channel integration so
info/debuglevel logs are captured alongside errors, not just exceptions - An Artisan command (
sentry:publish --dsn=...) that scaffoldsconfig/sentry.phpand writes the DSN into.env - Built-in tracing integrations for HTTP requests, queued jobs, and database/log operations (
Tracing/,Jobs/,Http/,Logs/) - A manual capture API (
Sentry\captureException()) for reporting caught exceptions explicitly - Version-gated compatibility across Laravel 6.x through 13.x and legacy Lumen, documented per SDK version
Common Use Cases
- Adding production error monitoring to a Laravel application with a few lines of bootstrap configuration
- Capturing performance traces for HTTP requests and queued jobs to diagnose latency issues in a Laravel app
- Routing Laravel log output (not just exceptions) into Sentry via the log-channel integration
- Manually reporting caught exceptions from within try/catch blocks using
captureException() - Upgrading a legacy Laravel/Lumen application onto a maintained error-monitoring SDK compatible with its specific framework version
Under The Hood
Architecture: The package registers a ServiceProvider/BaseServiceProvider that wires Laravel’s container to the underlying sentry/sentry PHP client, with EventHandler.php and Integration.php bridging Laravel’s exception/event system into Sentry capture calls; instrumentation is split by concern into Tracing/ (performance spans), Http/ (request-level context), Jobs/ (queue job tracing), Logs/ (log-channel bridging), and Features/ (opt-in capability flags), totaling roughly 1,800 lines across the core src/Sentry/Laravel classes. Tech Stack: PHP supporting both 7.2 and 8.x, targeting illuminate/support ^6.0 through ^13.0 in a single codebase, with sentry/sentry as the core dependency and symfony/psr-http-message-bridge plus nyholm/psr7 for PSR-7 HTTP message interop. Code Quality: 50+ PHP test files cover the integration surface, with phpstan.neon/phpstan-baseline.neon enforcing static analysis and friendsofphp/php-cs-fixer for style, run through a Makefile-driven workflow; the project maintains an unusually long, version-annotated compatibility matrix in its README rather than dropping older Laravel support silently. API Design: Setup is deliberately low-friction — one Artisan command scaffolds configuration, one line in bootstrap/app.php wires exception capture, and the SDK degrades gracefully across a wide span of Laravel major versions instead of requiring the latest release, which matters for a monitoring tool meant to work everywhere an app already runs.
Used by 8 apps in this directory
Akaunting
Invoicing Finance
Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.
Coolify
Devops · Hosting Control Panel
Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in
Hi.Events
Ecommerce · Scheduling
Self-hosted event ticketing platform that keeps your attendee data, brand, and revenue completely under your control.
Invoice Ninja
Invoicing Finance · Project Management
Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.
Leantime
Productivity · Project Management · Collaboration
Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira
OpnForm
Forms Surveys · Marketing
Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics
Vanguard Backup
Devops
Self-hosted backup automation for Ubuntu and Debian servers with S3 storage, SSH-based file and database backup, and multi-channel notifications.
Yaffa
Invoicing Finance
Self-hosted personal finance app for long-term financial planning with AI-powered transaction parsing and investment tracking.