Schedule recurring health checks against any notifiable model, send throttled alert notifications when they fail and dispatch events when they fail, escalate or recover.
roundly-consulting/alerts-for-laravel is a Laravel package for schedule recurring health checks against any notifiable model, send throttled alert notifications when they fail and dispatch events when they fail, escalate or recover..
It currently has 5 GitHub stars and 94 downloads on Packagist (latest version 1.2.2).
Install it with composer require roundly-consulting/alerts-for-laravel.
Discover more Laravel packages by roundly-consulting
or browse all Laravel packages to compare alternatives.
Last updated
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.
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.
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
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.
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.
The MIT License (MIT). Please see License File for more information.