Weave 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
Sentry Laravel

Sentry Laravel Laravel Package

sentry/sentry-laravel

Official Sentry SDK for Laravel. Adds error and performance monitoring with minimal setup: install via Composer and wire it into bootstrap/app.php to capture unhandled exceptions. Covers Laravel 11.x and 12.x, with guides for older versions and Lumen.

View on GitHub
Deep Wiki
Context7

Official Sentry SDK for Laravel — add real-time error monitoring, performance tracing, and logging to Laravel 11/12 applications with minimal setup. It hooks into the framework's exception handler to automatically report unhandled exceptions, with deep integrations for queues, HTTP requests, and Artisan commands.

  • Automatic error capture for unhandled exceptions and logs
  • Performance monitoring with transactions and spans
  • Queue and job tracing for background workers
  • Rich context via breadcrumbs, user data, and request details
  • Simple setup through bootstrap/app.php and publishable config
Frequently asked questions about Sentry Laravel
How do I install sentry/sentry-laravel for Laravel 12 or 11?
Run `composer require sentry/sentry-laravel` to install the package. Then, enable exception handling in `bootstrap/app.php` by adding `Integration::handles()` to your `Exceptions` configuration. Follow the [official Laravel 12/11 docs](https://docs.sentry.io/platforms/php/guides/laravel/) for step-by-step setup.
Does sentry/sentry-laravel support Laravel 10 or older versions?
Yes, the package supports Laravel 10, 9, 8, 7, 6, and even 5.x/Lumen. Check the [version-specific guides](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/) for installation and configuration details tailored to your Laravel version.
How do I configure sentry/sentry-laravel to capture only critical errors?
Use the `ignore_exceptions` config array in `.env` or `config/sentry.php` to exclude specific exceptions. Alternatively, override `Integration::handles()` in `bootstrap/app.php` to filter exceptions dynamically. For example, exclude `HttpException` with `Integration::handles([], ['Illuminate\Http\Exceptions\HttpException'])`.
Can I use sentry/sentry-laravel for performance monitoring, not just errors?
Yes, the package supports performance monitoring via traces and metrics. Enable structured logging with `SENTRY_ENABLE_LOGS=true` and configure `SENTRY_TRACES_SAMPLE_RATE` in `.env`. For advanced use, integrate OTLP (OpenTelemetry) or use Sentry’s middleware like `SentryTracesSampleRate` for job/queue sampling.
Will sentry/sentry-laravel slow down my Laravel application in production?
The package is optimized for low overhead. By default, it only captures unhandled exceptions and logs. Performance impact is minimal unless you enable traces or metrics. Adjust `SENTRY_LOG_FLUSH_THRESHOLD` and `SENTRY_TRACES_SAMPLE_RATE` to balance observability and performance.
How do I ensure user data (PII) isn’t accidentally sent to Sentry?
Override the `getUser()` method in the Sentry facade to sanitize or exclude sensitive data. Alternatively, use the `beforeSend` hook in your Sentry configuration to filter events. For example, remove `user.email` from events before sending: `SentryeforeSend(function ($event) { unset($event['user']['email']); return $event; });`
Does sentry/sentry-laravel work with Laravel queues or Octane?
Yes, it supports Laravel queues and Octane. For queues, traces propagate automatically via Laravel Context (v4.21.0+). For Octane, ensure you’re using Sentry PHP SDK v4.22.0+ to avoid trace continuity issues. Test async workflows in staging to confirm trace propagation.
How do I configure sentry/sentry-laravel to track releases and source maps?
Set `SENTRY_RELEASE` in `.env` to match your Laravel version or custom release tag. Upload source maps via the Sentry CLI or API to enable accurate error stack traces. Use `php artisan sentry:releases` to manage releases and files. For Laravel Mix/Vite, integrate source maps automatically via Sentry’s [Laravel docs](https://docs.sentry.io/platforms/php/guides/laravel/release-management/).
Can I use sentry/sentry-laravel alongside other error trackers like Rollbar?
Yes, but avoid duplicate reporting by configuring `ignore_exceptions` to exclude errors already handled by other tools. For example, if Rollbar captures `HttpException`, exclude it in Sentry’s config. Test in staging to ensure no conflicts or missed errors.
How do I test sentry/sentry-laravel locally before deploying to production?
Set `SENTRY_ENVIRONMENT=development` in `.env` to avoid sending events to production. Use `SENTRY_DSN=YOUR_DEV_DSN` for a local Sentry project. Manually trigger errors with `throw new Exception('Test')` or use `php artisan tinker` to test exception handling. Verify events appear in your Sentry dashboard.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections