Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Back End

    • Action Logger
    • Addresses
    • Algolia
    • Algolia Webshop
    • API
    • Audits
    • Avatars
    • Cache Chain
    • Calendar
    • Cargo Partner
    • Categories
    • Charts
    • CI/CD
    • Cli
    • CNP Validator
    • Comments
    • Commercial
    • Companies
    • Core
    • Countries
    • Currencies
    • Data Export
    • Data Import
    • Discounts
    • Documents
    • Dynamic Methods
    • EAV
    • Emag
    • Enums
    • Excel
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Helpers
    • Holidays
    • How-to
    • Image Transformer
    • Impersonate
    • Interactions
    • Inventory
    • IO
    • Localisation
    • Lockable Models
    • Logs
    • Measurement Units
    • Meili Search
    • Meili Search Webshop
    • Menus
    • Migrator
    • Monitored Emails
    • Notifications
    • Packaging Units
    • PDF
    • People
    • Permissions
    • Product Eav
    • Product Lots
    • Products
    • Questionnaires
    • Rememberable
    • Roles
    • Sale Channels
    • Searchable
    • Select
    • Sentry
    • Services
    • Smart Bill
    • Sms Advert
    • Stripe
    • Tables
    • Tasks
    • Teams
    • Ticketing
    • Track Who
    • Tutorials
    • Typesense
    • Typesense Webshop
    • Unit Conversion
    • Upgrade
    • UPS
    • User Groups
    • Users
    • Versions
    • Virtual Call Center
    • Vouchers
    • Webshop
    • Webshop Commercial

Sentry

LicenseStableDownloadsPHPIssuesMerge Requests

Description

Sentry integrates Laravel Enso with Sentry error reporting.

The package provides a small exception-reporting helper that enriches captured events with the current Enso user and role, deduplicates repeated exceptions for a configurable interval, stores the last Sentry event id per authenticated user, and exposes an authenticated endpoint that allows the frontend to retrieve that event id.

It is designed to complement Enso's backend exception pipeline and frontend error-reporting flows without requiring application code to talk to the Sentry SDK directly.

Installation

Install the package in an application that already uses the Sentry Laravel SDK:

composer require laravel-enso/sentry

If needed, publish the package config:

php artisan vendor:publish --tag=enso-sentry-config

Default configuration:

return [
    'dedupeInterval' => 5,
];

Features

  • Reports unhandled exceptions through the Sentry Laravel integration.
  • Enriches Sentry scope with the authenticated Enso user id, name, email, and role.
  • Deduplicates repeated exceptions for a configurable interval.
  • Stores the latest Sentry event id per authenticated user in cache.
  • Exposes an authenticated API endpoint for reading the current event id from the frontend.
  • Falls back to the file cache store for Redis exceptions during dedupe checks.

Usage

Report an exception through the package handler:

use LaravelEnso\Sentry\Exceptions\Handler;

Handler::report($exception);

Read the current event id from backend code:

$eventId = Handler::eventId();

The frontend can retrieve the same value from:

route('sentry');

Which returns:

{
  "eventId": "..."
}

Tip

The handler stores the event id only when the application is running in production and an authenticated user is available.

API

Route

Authenticated endpoint:

  • GET /api/sentry

Route name:

  • sentry

Middleware:

  • api
  • auth

Controller

LaravelEnso\Sentry\Http\Controllers\Sentry

Returns:

  • eventId

Exception Handler Helper

LaravelEnso\Sentry\Exceptions\Handler

Public methods:

  • report(Throwable $exception): void
  • eventId(): ?string

Behavior:

  • skips duplicate exceptions within the dedupe interval
  • resolves the current user across the configured default guard, web, and sanctum
  • sends the exception to Sentry as an unhandled exception
  • stores the last event id per authenticated user when running in production

Configuration

config/enso/sentry.php

Keys:

  • dedupeInterval

Depends On

Framework dependency:

  • laravel/framework ↗

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

Edit this page on GitHub
Last Updated: 4/19/2026, 10:25:58 PM
Prev
Select
Next
Services