PHPackages                             snb4crazy/notifyhub-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. snb4crazy/notifyhub-laravel

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

snb4crazy/notifyhub-laravel
===========================

Laravel client package for sending events to a NotifyHub server.

v1.0.0(today)00MITPHPPHP ^8.2CI passing

Since May 29Pushed todayCompare

[ Source](https://github.com/snb4crazy/notifyhub-laravel)[ Packagist](https://packagist.org/packages/snb4crazy/notifyhub-laravel)[ Docs](https://github.com/snb4crazy/notifyhub-laravel)[ RSS](/packages/snb4crazy-notifyhub-laravel/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (6)Used By (0)

notifyhub-laravel
=================

[](#notifyhub-laravel)

[![Tests](https://github.com/snb4crazy/notifyhub-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/snb4crazy/notifyhub-laravel/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/197c6f38155d4f295fb1602143b02d2f85eba3dd1cba4fe555c796055d2b05aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e62346372617a792f6e6f746966796875622d6c61726176656c2e737667)](https://packagist.org/packages/snb4crazy/notifyhub-laravel)[![License](https://camo.githubusercontent.com/c4d4caf23ca66a189278807063b365126d94374731da0833b16a341d18449ead/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736e62346372617a792f6e6f746966796875622d6c61726176656c)](LICENSE)

Laravel client package for sending events to a [NotifyHub](https://github.com/snb4crazy/NotifyHub) server.

Requirements
------------

[](#requirements)

DependencyVersionPHP8.2+Laravel10, 11, 12, 13For Laravel 13, PHP 8.3+ is required by Laravel itself.

The package test matrix is validated on PHP 8.2 with Laravel 10–12, and PHP 8.3 / 8.4 with Laravel 13.

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

[](#installation)

```
composer require snb4crazy/notifyhub-laravel
```

Publish the config file:

```
php artisan vendor:publish --provider="NotifyHub\\LaravelClient\\NotifyHubServiceProvider" --tag=notifyhub-config
```

If Laravel still reports no publishable resources, make sure package discovery is enabled in the consuming app and refresh Composer's autoload/package manifest.

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

[](#configuration)

Add to `.env` in the **sending** app:

```
NOTIFYHUB_ENABLED=true
NOTIFYHUB_URL=https://your-notifyhub-server.example.com
NOTIFYHUB_INGEST_KEY=your_project_ingest_key
NOTIFYHUB_TIMEOUT=5
NOTIFYHUB_RETRY_TIMES=2
NOTIFYHUB_RETRY_SLEEP_MS=200
```

Optional auto-reporting of logged exceptions:

```
NOTIFYHUB_AUTO_REPORT=true
NOTIFYHUB_AUTO_REPORT_MIN_LEVEL=error
```

Usage
-----

[](#usage)

### Send a plain event

[](#send-a-plain-event)

```
use NotifyHub\LaravelClient\Facades\NotifyHub;
use NotifyHub\LaravelClient\Data\EventPayload;

NotifyHub::send(new EventPayload(
    title: 'Payment declined',
    message: 'Stripe returned error code card_declined',
    severity: 'error',
    eventType: 'payment.failed',
    application: config('app.name'),
    environment: app()->environment(),
    context: ['order_id' => $order->id],
));
```

### Report an exception

[](#report-an-exception)

```
try {
    $this->chargeCard($order);
} catch (\Throwable $e) {
    NotifyHub::sendException($e, ['order_id' => $order->id]);
    throw $e;
}
```

Or use the `EventPayload` factories directly:

```
NotifyHub::send(EventPayload::fromException($exception));
NotifyHub::send(EventPayload::fromFailedJob(SendEmail::class, $exception));
NotifyHub::send(EventPayload::fromFailedCron('nightly-sync', 'exit 1'));
```

### Use the DI interface

[](#use-the-di-interface)

```
use NotifyHub\LaravelClient\Contracts\NotifyHubClientInterface;

class MyService
{
    public function __construct(private NotifyHubClientInterface $notifyHub) {}

    public function doWork(): void
    {
        try {
            // ...
        } catch (\Throwable $e) {
            $this->notifyHub->sendException($e);
        }
    }
}
```

### Send a raw array

[](#send-a-raw-array)

```
NotifyHub::sendRaw([
    'title'    => 'Custom alert',
    'message'  => 'Something interesting happened',
    'severity' => 'info',
    'event_type' => 'custom.event',
]);
```

### Integration in the Laravel exception handler

[](#integration-in-the-laravel-exception-handler)

Add to `bootstrap/app.php` (Laravel 11+) or `App\Exceptions\Handler` (Laravel 10):

```
// bootstrap/app.php
->withExceptions(function (Exceptions $exceptions) {
    $exceptions->report(function (\Throwable $e) {
        rescue(fn () => app(\NotifyHub\LaravelClient\Contracts\NotifyHubClientInterface::class)
            ->sendException($e));
    });
})
```

Or in Laravel 10's `app/Exceptions/Handler.php`:

```
public function register(): void
{
    $this->reportable(function (\Throwable $e) {
        rescue(fn () => app(\NotifyHub\LaravelClient\Contracts\NotifyHubClientInterface::class)
            ->sendException($e));
    });
}
```

Event payload contract
----------------------

[](#event-payload-contract)

FieldTypeRequiredNotes`title`string✓Max 140 chars`message`string✓Max 5000 chars`severity`string✓`info`, `warning`, `error`, `critical``event_type`string–e.g. `laravel.exception`, `queue.failed``application`string–Identifies the sending app`environment`string–`production`, `staging`, `local``context`object–Non-sensitive metadata (visible to all members)`sensitive_context`object–Stack traces, file paths (role-redacted on server)`fingerprint`string–For future deduplication/grouping`occurred_at`ISO 8601–When the incident happenedTesting
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Every ~11 days

Total

3

Last Release

0d ago

Major Versions

v0.2.0 → v1.0.02026-06-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4397652?v=4)[Serhii](/maintainers/snb4crazy)[@snb4crazy](https://github.com/snb4crazy)

---

Top Contributors

[![snb4crazy](https://avatars.githubusercontent.com/u/4397652?v=4)](https://github.com/snb4crazy "snb4crazy (16 commits)")

---

Tags

laravelmonitoringexceptionsalertingnotifyhub

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/snb4crazy-notifyhub-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.5k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M115](/packages/laravel-mcp)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

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