Search by

roundly-consulting / alerts-for-laravel

mihaliak

Schedule recurring health checks against any notifiable model, send throttled alert notifications when they fail and dispatch events when they fail, escalate or recover.

Package info

github.com/roundly-consulting/alerts-for-laravel

pkg:composer/roundly-consulting/alerts-for-laravel

Fund package maintenance!

Patreon

Statistics

Installs: 9

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-03 17:56 UTC

This package is auto-updated.

Last update: 2026-10-03 18:06:13 UTC


README

Alerts for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

Alerts for Laravel

Schedule recurring health checks against any notifiable model — your own Check classes or the built-in database, cache, queue, storage and HTTP checks. A failing check opens an alert and sends throttled, escalating notifications; a recovered one closes it, with run history, uptime and a status report on top.

Installation

Requires PHP 8.4 and Laravel 12 or 13.

composer require roundly-consulting/alerts-for-laravel
php artisan vendor:publish --tag="alerts-migrations"
php artisan migrate

If your owner models have UUID/ULID keys, set ALERTS_KEY_TYPE before migrating. Due checks are dispatched as queued jobs by the auto-scheduled alerts:perform-health-checks, so keep the scheduler and a queue worker running.

Usage

Register checks once, in a service provider's boot() — the built-ins ship a default notification:

use RoundlyConsulting\Alerts\Checks\DatabaseCheck;
use RoundlyConsulting\Alerts\Checks\HttpPingCheck;
use RoundlyConsulting\Alerts\Facades\Health;

Health::check(DatabaseCheck::make());
Health::check(HttpPingCheck::make('https://api.example.com')->timeout(5)->slowerThan(800));

Let the owner model decide who gets notified:

use Closure;
use RoundlyConsulting\Alerts\Interfaces\HasNotifiablesForAlerts;
use RoundlyConsulting\Alerts\Traits\UsesHealthChecks;

final class Team extends Model implements HasNotifiablesForAlerts
{
    use UsesHealthChecks;

    public function forEachNotifiableForAlerts(Closure $callback): void
    {
        $this->members->each(fn (User $member) => $callback($member));
    }
}

Monitor a check for that owner — a failure opens an alert and notifies the team, a recovery closes it:

Health::for($team)->monitor(HttpPingCheck::class)
    ->everyFiveMinutes()
    ->failAfter(3)                                // open an alert only after 3 failures in a row
    ->save();

Health::for($team)->run(HttpPingCheck::class);    // or run it now: a CheckResult
Health::report()->isHealthy();                    // bool, across every scheduled check

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/alerts-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

Donate to Roundly open source Become a patron on Patreon Donate crypto: BTC, ETH, BNB or SOL

License

The MIT License (MIT). Please see License File for more information.