PHPackages                             zing/laravel-sentry - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. zing/laravel-sentry

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

zing/laravel-sentry
===================

Provides sentry context middleware.

3.5.0(1mo ago)11.1kMITPHPPHP ^8.0CI passing

Since May 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/zingimmick/laravel-sentry)[ Packagist](https://packagist.org/packages/zing/laravel-sentry)[ Docs](https://github.com/zingimmick/laravel-sentry)[ RSS](/packages/zing-laravel-sentry/feed)WikiDiscussions 3.x Synced today

READMEChangelog (10)Dependencies (16)Versions (31)Used By (0)

Laravel Sentry
==============

[](#laravel-sentry)

[![Build Status](https://github.com/zingimmick/laravel-sentry/actions/workflows/tests.yml/badge.svg)](https://github.com/zingimmick/laravel-sentry/actions)[![Code Coverage](https://camo.githubusercontent.com/0ddefd2e04598e7b4f66f8ad8baf195708757f8f70b13e45f317b8c9ec3e8ef3/68747470733a2f2f636f6465636f762e696f2f67682f7a696e67696d6d69636b2f6c61726176656c2d73656e7472792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/zingimmick/laravel-sentry)[![Latest Stable Version](https://camo.githubusercontent.com/af1c4164e759e2d977fef0f61b30f504e5bb136dea84268449eb957bc2b49d35/68747470733a2f2f706f7365722e707567782e6f72672f7a696e672f6c61726176656c2d73656e7472792f762f737461626c652e737667)](https://packagist.org/packages/zing/laravel-sentry)[![Total Downloads](https://camo.githubusercontent.com/5d575c890b165fab8556b209501a6f8b6ce703c2f153156a5aab507af3e82116/68747470733a2f2f706f7365722e707567782e6f72672f7a696e672f6c61726176656c2d73656e7472792f646f776e6c6f616473)](https://packagist.org/packages/zing/laravel-sentry)[![Latest Unstable Version](https://camo.githubusercontent.com/7c26a9e682bb685461ae443c7a72f21764cae4b841b6e0b71af8cfe7a64e0af1/68747470733a2f2f706f7365722e707567782e6f72672f7a696e672f6c61726176656c2d73656e7472792f762f756e737461626c652e737667)](https://packagist.org/packages/zing/laravel-sentry)[![License](https://camo.githubusercontent.com/0cbb80a4db631c46c8972f0b138da93769d390ae8035a18ad4faa3229c0df2b9/68747470733a2f2f706f7365722e707567782e6f72672f7a696e672f6c61726176656c2d73656e7472792f6c6963656e7365)](https://packagist.org/packages/zing/laravel-sentry)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8bfc7406752f827b3545f65190632a988c1a071826280350b7e6e8176c906fe9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a696e67696d6d69636b2f6c61726176656c2d73656e7472792f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/zingimmick/laravel-sentry)[![](https://camo.githubusercontent.com/10b3c7598c9b39d132cc89ec256ef1185a32d56478a102a94e03fa626dc3b395/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35613935613037346263643338666433386461302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/zingimmick/laravel-sentry/maintainability)

### Requirements

[](#requirements)

- [PHP 8.0+](https://php.net/releases/)
- [Composer](https://getcomposer.org)
- [Laravel 8.0+](https://laravel.com/docs/releases)

Require Laravel Sentry using [Composer](https://getcomposer.org):

```
composer require zing/laravel-sentry
```

Usage
-----

[](#usage)

### Add user context

[](#add-user-context)

```
use Zing\LaravelSentry\Middleware\SentryContext;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    protected $middleware = [
        // ...
        SentryContext::class,
    ];

    // ...
}
```

### Custom user context

[](#custom-user-context)

```
use Zing\LaravelSentry\Middleware\SentryContext;

class CustomSentryContext extends SentryContext
{
    /**
     * @param \Zing\LaravelSentry\Tests\User $user
     *
     * @return array|mixed[]
     */
    protected function resolveUserContext(string $guard, \Illuminate\Contracts\Auth\Authenticatable $user): array
    {
        if ($guard === 'api') {
            return [
                'id' => $user->getAuthIdentifier(),
                'username' => $user->username,
            ];
        }

        return parent::resolveUserContext($guard, $user);
    }
}
```

License
-------

[](#license)

Laravel Sentry is an open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance90

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 56.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~212 days

Total

30

Last Release

45d ago

Major Versions

0.3.1 → 1.0.02020-09-28

1.0.0 → 2.0.02020-09-28

1.0.1 → 2.0.12020-11-23

2.x-dev → 3.0.02022-12-18

PHP version history (4 changes)0.0.1PHP ^7.2

0.3.0PHP ^7.2 || ^8.0

2.x-devPHP ^7.3 || ^8.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafa5bffa28dcd722432b244bf3f0bfe773406df29fea295847e2397b95d50b?d=identicon)[zingimmick](/maintainers/zingimmick)

---

Top Contributors

[![zingimmick](https://avatars.githubusercontent.com/u/26657141?v=4)](https://github.com/zingimmick "zingimmick (164 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (103 commits)")[![kodiakhq[bot]](https://avatars.githubusercontent.com/in/29196?v=4)](https://github.com/kodiakhq[bot] "kodiakhq[bot] (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (3 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (1 commits)")

---

Tags

laravelsentrylaravelsentry

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/zing-laravel-sentry/health.svg)

```
[![Health](https://phpackages.com/badges/zing-laravel-sentry/health.svg)](https://phpackages.com/packages/zing-laravel-sentry)
```

###  Alternatives

[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[jenssegers/raven

Sentry (Raven) error monitoring integration for Laravel projects

90197.2k1](/packages/jenssegers-raven)[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

63541.6k1](/packages/ytake-laravel-fluent-logger)[rcrowe/laravel-sentry

Tasty intergration of Laravel &amp; Sentry for sweet reporting of your logs

152.8k](/packages/rcrowe-laravel-sentry)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
