PHPackages                             upgradelabs/sentinel-laravel - 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. upgradelabs/sentinel-laravel

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

upgradelabs/sentinel-laravel
============================

Laravel error reporting client for Sentinel. Captures exceptions and sends them to your Sentinel dashboard.

0.0.1(1mo ago)01↑2900%MITPHPPHP ^8.0CI failing

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/upgradelabs/sentinel-laravel)[ Packagist](https://packagist.org/packages/upgradelabs/sentinel-laravel)[ RSS](/packages/upgradelabs-sentinel-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (2)Used By (0)

Sentinel Laravel
================

[](#sentinel-laravel)

Error reporting client for [Sentinel](https://sentinel.upgradelabs.pt). Captures exceptions from your Laravel application and sends them to your Sentinel dashboard.

**Compatible with Laravel 8, 9, 10, 11, 12, and 13.**

Installation
------------

[](#installation)

```
composer require upgradelabs/sentinel-laravel
```

Configuration
-------------

[](#configuration)

Add your Sentinel API token to `.env`:

```
SENTINEL_TOKEN=your-project-api-token
```

That's it. Sentinel will automatically capture and report unhandled exceptions.

The token identifies your project — you get it when creating a project on the Sentinel dashboard or via `php artisan sentinel:create-project` on the Sentinel server.

### Publish config (optional)

[](#publish-config-optional)

```
php artisan vendor:publish --tag=sentinel-config
```

Optional Configuration
----------------------

[](#optional-configuration)

### Report only from specific environments

[](#report-only-from-specific-environments)

```
SENTINEL_ENVIRONMENTS=production,staging
```

### Send reports via queue (recommended for production)

[](#send-reports-via-queue-recommended-for-production)

```
SENTINEL_QUEUE=default
```

### Disable reporting

[](#disable-reporting)

```
SENTINEL_ENABLED=false
```

### Heartbeat (automatic)

[](#heartbeat-automatic)

Sentinel pings the dashboard every 5 minutes to report your app is alive. This powers the status page. It's enabled by default — requires the Laravel scheduler to be running:

```
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

To disable:

```
SENTINEL_HEARTBEAT=false
```

### Ignored exceptions

[](#ignored-exceptions)

Edit `config/sentinel.php` to customize which exceptions are ignored:

```
'ignored_exceptions' => [
    Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class,
    Illuminate\Validation\ValidationException::class,
],
```

Manual Reporting
----------------

[](#manual-reporting)

You can manually report exceptions:

```
// Report an exception manually
try {
    // risky operation
} catch (\Throwable $e) {
    app(\UpgradeLabs\SentinelLaravel\SentinelReporter::class)->report($e);
}
```

Laravel 8/9 (Manual Handler Setup)
----------------------------------

[](#laravel-89-manual-handler-setup)

For older Laravel versions where automatic `reportable()` registration may not work, add the trait to your exception handler:

```
// app/Exceptions/Handler.php
use UpgradeLabs\SentinelLaravel\ReportsToSentinel;

class Handler extends ExceptionHandler
{
    use ReportsToSentinel;

    public function register(): void
    {
        $this->reportable(function (\Throwable $e) {
            $this->reportToSentinel($e);
        });
    }
}
```

What Gets Reported
------------------

[](#what-gets-reported)

Each error report includes:

- **Exception class, message, file, line**
- **Full stack trace**
- **Severity** (auto-detected: fatal, error, warning, notice)
- **Laravel &amp; PHP version**
- **Environment** (production, staging, local, etc.)
- **Request data** (URL, method, headers, input — sensitive fields redacted)
- **Authenticated user** (id, email, name)
- **Previous exception** chain
- **Custom context** (order\_id, payment\_method, etc.)
- **Breadcrumbs** (DB queries, cache, jobs — sequence of events before the error)
- **Performance** (request duration, memory usage — when middleware is active)

### Data Privacy

[](#data-privacy)

Sensitive fields are automatically redacted from request data:

- `password`, `password_confirmation`
- `token`, `secret`
- `credit_card`, `card_number`, `cvv`, `ssn`
- Authorization, Cookie, and CSRF headers

Deploy Tracking
---------------

[](#deploy-tracking)

Notify Sentinel when you deploy so you can correlate errors with releases.

### Artisan command (recommended)

[](#artisan-command-recommended)

```
# Auto-detect version, commit, and branch from git
php artisan sentinel:deploy --auto

# With explicit values
php artisan sentinel:deploy --tag=1.2.0 --deployer="GitHub Actions"

# Full options
php artisan sentinel:deploy \
  --tag=1.2.0 \
  --commit=abc123def \
  --branch=main \
  --environment=production \
  --deployer="CI/CD" \
  --description="Fix payment bug"
```

All flags are optional. Use `--auto` to detect tag (from git tag), commit hash, and branch automatically.

### In CI/CD pipelines

[](#in-cicd-pipelines)

**GitHub Actions:**

```
- name: Notify Sentinel of deploy
  run: php artisan sentinel:deploy --auto --deployer="GitHub Actions"
```

**Laravel Forge / Envoyer (deploy script):**

```
php artisan sentinel:deploy --auto --deployer="Forge"
```

**Or with curl (no package needed):**

```
curl -X POST https://sentinel.upgradelabs.pt/api/v1/deploy \
  -H "Authorization: Bearer $SENTINEL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "version": "1.2.0",
    "commit_hash": "'$(git rev-parse HEAD)'",
    "branch": "'$(git branch --show-current)'",
    "environment": "production",
    "deployer": "CI/CD"
  }'
```

### Programmatic usage

[](#programmatic-usage)

```
app(\UpgradeLabs\SentinelLaravel\SentinelClient::class)->deploy([
    'version' => '1.2.0',
    'commit_hash' => 'abc123',
    'branch' => 'main',
    'environment' => 'production',
    'deployer' => 'CI/CD',
]);
```

Context Enrichment
------------------

[](#context-enrichment)

Add custom context that gets attached to any error that occurs during the request:

```
use UpgradeLabs\SentinelLaravel\SentinelContext;

// Add context — available in the error report's "context" section
SentinelContext::set([
    'order_id' => 123,
    'payment_method' => 'stripe',
    'subscription_plan' => 'pro',
]);

// Context is automatically cleared after each error report
```

Breadcrumbs
-----------

[](#breadcrumbs)

Breadcrumbs automatically track the sequence of events leading up to an error. Enabled by default.

**Auto-captured events:**

- Database queries (SQL, time, connection)
- Cache hits and misses
- Queue job processing

**Add manual breadcrumbs:**

```
use UpgradeLabs\SentinelLaravel\SentinelContext;

SentinelContext::breadcrumb('payment', 'Charging customer', ['amount' => 99.99]);
SentinelContext::breadcrumb('api', 'Called Stripe API', ['endpoint' => '/charges']);
```

**Configure in `config/sentinel.php`:**

```
'breadcrumbs' => [
    'enabled' => true,
    'queries' => true,   // DB queries
    'cache' => false,     // Cache events
    'jobs' => true,       // Queue jobs
],
```

Performance Tracking
--------------------

[](#performance-tracking)

Track request duration and memory usage by adding the middleware:

```
// In app/Http/Kernel.php or bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \UpgradeLabs\SentinelLaravel\Middleware\TrackSentinelPerformance::class,
    ]);
})
```

Performance data (duration\_ms, memory\_peak\_mb) is automatically included in error reports.

Log Channel
-----------

[](#log-channel)

Send Laravel log entries to Sentinel by adding a custom log channel:

```
// config/logging.php
'channels' => [
    'sentinel' => [
        'driver' => 'custom',
        'via' => \UpgradeLabs\SentinelLaravel\SentinelLogChannel::class,
        'level' => 'error', // Only send error and above
    ],
],
```

Then use it alongside your default channel:

```
// .env
LOG_CHANNEL=stack
LOG_STACK=daily,sentinel

// Or log to Sentinel explicitly
Log::channel('sentinel')->error('Payment failed', ['order_id' => 123]);
```

Read API
--------

[](#read-api)

Pull data from Sentinel for external tools (Grafana, custom dashboards):

```
# Project stats
curl -H "Authorization: Bearer TOKEN" https://sentinel.upgradelabs.pt/api/v1/stats

# Errors (paginated, filterable by status/severity)
curl -H "Authorization: Bearer TOKEN" https://sentinel.upgradelabs.pt/api/v1/errors?status=unresolved

# Deploys
curl -H "Authorization: Bearer TOKEN" https://sentinel.upgradelabs.pt/api/v1/deploys

# Downtime history
curl -H "Authorization: Bearer TOKEN" https://sentinel.upgradelabs.pt/api/v1/downtime
```

Testing
-------

[](#testing)

### Verify configuration

[](#verify-configuration)

```
php artisan tinker

>>> app(\UpgradeLabs\SentinelLaravel\SentinelClient::class)->isConfigured()
// Should return: true
```

### Test error reporting

[](#test-error-reporting)

```
php artisan tinker

>>> $response = app(\UpgradeLabs\SentinelLaravel\SentinelClient::class)->testReport()
>>> $response->status()   // Should return: 201
>>> $response->json()     // Should show: {"message": "Error reported successfully.", ...}

# Or test with a real exception
>>> app(\UpgradeLabs\SentinelLaravel\SentinelReporter::class)->report(new \RuntimeException('Test from tinker'))
```

### Test heartbeat

[](#test-heartbeat)

Send a manual heartbeat to verify your app shows as "Online" on the Sentinel status page:

```
php artisan tinker

>>> $response = app(\UpgradeLabs\SentinelLaravel\SentinelClient::class)->heartbeat()
>>> $response->status()   // Should return: 200
>>> $response->json()     // Should show: {"message": "pong", "project": "...", ...}
```

Or test with curl using your project's API token:

```
curl -H "Authorization: Bearer YOUR_PROJECT_TOKEN" \
  https://sentinel.upgradelabs.pt/api/v1/health
```

Once a heartbeat is received, your project shows as **Online** on the status page. If no heartbeat is received for 10+ minutes, it switches to **Offline** and a critical alert email is sent.

With the scheduler running (`* * * * * php artisan schedule:run`), heartbeats are sent automatically every 5 minutes — no manual work needed.

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b20557c62a96fca9a58d80b11dffbaf4e3debd77d9358c66ed06d413c1e884a7?d=identicon)[rpsimao](/maintainers/rpsimao)

---

Top Contributors

[![rpsimao](https://avatars.githubusercontent.com/u/205846?v=4)](https://github.com/rpsimao "rpsimao (11 commits)")

---

Tags

laravelloggingexceptionssentinelerror-tracking

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/upgradelabs-sentinel-laravel/health.svg)

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

###  Alternatives

[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90234.6M36](/packages/bugsnag-bugsnag-laravel)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10619.4k](/packages/naoray-laravel-github-monolog)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.5k1](/packages/melihovv-laravel-log-viewer)

PHPackages © 2026

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