PHPackages                             nazirul-amin/sentinel-actor - 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. nazirul-amin/sentinel-actor

ActiveLibrary

nazirul-amin/sentinel-actor
===========================

A Laravel package for monitoring applications by sending exception and event data to webhook endpoints with HMAC-SHA256 signature verification.

v1.0.0(7mo ago)028[3 PRs](https://github.com/nazirul-amin/sentinel-actor/pulls)MITPHPPHP ^8.1CI passing

Since Oct 7Pushed 4mo agoCompare

[ Source](https://github.com/nazirul-amin/sentinel-actor)[ Packagist](https://packagist.org/packages/nazirul-amin/sentinel-actor)[ Docs](https://github.com/nazirul-amin/sentinel-actor)[ GitHub Sponsors](https://github.com/nazirulamin)[ RSS](/packages/nazirul-amin-sentinel-actor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (5)Used By (0)

Sentinel Actor
==============

[](#sentinel-actor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/17007b3a6e439c148d7d27b7ce7a723660f0232e897ec776f38e98caf4360504/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e617a6972756c2d616d696e2f73656e74696e656c2d6163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nazirul-amin/sentinel-actor)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1040287411a050375ae69cb59d549bcb4c0a310d29d0567340256d09109efaf3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e617a6972756c2d616d696e2f73656e74696e656c2d6163746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/nazirul-amin/sentinel-actor/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d20a1df1e251484b24ab7edb945d9584fdf85ad563e4813bfad0d53e3d632396/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e617a6972756c2d616d696e2f73656e74696e656c2d6163746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/nazirul-amin/sentinel-actor/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/65492b8414feb93e6399ba6b82390af5cbade1659817a2b9f11a416579b56cca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e617a6972756c2d616d696e2f73656e74696e656c2d6163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nazirul-amin/sentinel-actor)

This package provides a simple way to monitor your application by sending exception data to a webhook endpoint. It includes traits and utilities to automatically send exception information from jobs, notifications, and other parts of your application. Compatible with PHP 8.1+ and Laravel 10+.

Installation
============

[](#installation)

You can install the package via composer (compatible with PHP 8.1+ and Laravel 10+):

```
composer require nazirul-amin/sentinel-actor
```

You can publish the config file with:

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

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Monitoring Client Configuration
    |--------------------------------------------------------------------------
    |
    | Here you can configure the monitoring client settings.
    |
    */

    'webhook' => [
        'url' => env('SENTINEL_WEBHOOK_URL'),
        'endpoint' => env('SENTINEL_EXCEPTION_URL', '/application/exceptions'),
        'status_endpoint' => env('SENTINEL_STATUS_URL', '/application/status'),
        'application_id' => env('SENTINEL_APPLICATION_ID', 'app-id'),
        'application_version' => env('SENTINEL_APPLICATION_VERSION', '1.0.0'),
        'secret' => env('SENTINEL_WEBHOOK_SECRET'),
    ],

    'enabled' => env('SENTINEL_ENABLED', true),

    'levels' => [
        'info',
        'success',
        'warning',
        'error',
        'critical'
    ],
];
```

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

[](#configuration)

Add the following environment variables to your `.env` file:

```
SENTINEL_WEBHOOK_URL=https://your-monitoring-service.com/webhook
SENTINEL_EXCEPTION_URL=/application/exceptions
SENTINEL_STATUS_URL=/application/status
SENTINEL_APPLICATION_ID=your-app-name
SENTINEL_APPLICATION_VERSION=1.0.0
SENTINEL_WEBHOOK_SECRET=your-hmac-secret
SENTINEL_ENABLED=true
```

HMAC Signature Verification
---------------------------

[](#hmac-signature-verification)

This package supports HMAC signature verification for enhanced security. When you configure a secret in your `.env` file, all outgoing webhook requests will be signed with HMAC-SHA256.

The receiving service can verify the authenticity of the request by comparing the signature in the `Sentinel-Signature` header with a locally computed signature using the same secret.

Usage
-----

[](#usage)

### Monitoring Exceptions in Jobs

[](#monitoring-exceptions-in-jobs)

To automatically send exception data from your jobs, simply use the `MonitorsExceptions` trait:

```
