dragon-code/sentriable-laravel
Sentriable Laravel is a lightweight Sentry integration for Laravel apps. It simplifies exception reporting and error monitoring, letting you capture issues, attach useful context, and keep production problems visible with minimal setup.
Start by requiring the package and wiring it into your user model, since that's the primary integration point for a "Sentriable" package.
composer require thedragoncode/sentriable-laravel
php artisan vendor:publish --tag=sentriable-config. Read through the config file first — it defines which model attributes get serialized to Sentry and how.Sentriable trait to your authenticatable model (App\Models\User). This is the whole point of the package: it exposes a toSentry() (or similarly named) method that Laravel/Sentry uses to build the user context attached to every event.sentry/sentry-laravel integration, it doesn't replace it.First use case: throw an exception somewhere inside an authenticated request, open the event in Sentry, and verify the User panel is populated. That's the fastest way to confirm the trait + config are working end to end.
toSentry() returning ['id' => ..., 'email' => ...]). This keeps the trait pure and avoids a giant config file of field mappings.id, an internal username, and maybe org/tenant id. Treat the method as a whitelist, not a blacklist.plan, role, or tenant, prefer adding them as tags via the Sentry SDK (\Sentry\configureScope(...)) rather than cramming them into the user payload — they're filterable and cheaper to search.before_send / before_send_transaction. If you ever need to redact something the trait let through, the Sentry callback is the right place, not a fork or wrapper.v2.1.0 is a minor bump from v2.0.1 with no documented breaking changes, so existing patterns should carry over; pin ^2.1 and let CI tell you if anything shifted.
php artisan config:cache (or config:clear in local dev). It's the most common reason "my changes aren't showing up."SENTRY_DEBUG=true locally or by logging toSentry() output — don't guess from the dashboard.sentry/sentry-laravel is on a version compatible with the constraint this package declares. Bumping this package alone can be a no-op if the SDK is stale.before_send hook and the Sentry event processor pipeline are where you should add custom augmentation that doesn't belong to a single model. Keep the trait dumb and the processors for cross-cutting concerns.How can I help you explore Laravel packages today?