---
title: "Events — Alerts for Laravel | Roundly"
description: "HealthCheckFailed, HealthCheckRecovered and HealthCheckEscalated — when each fires and what it carries."
url: https://roundly-consulting.com/open-source/docs/alerts-for-laravel/events
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Alerts for Laravel](https://roundly-consulting.com/open-source/docs/alerts-for-laravel.md)

# Events

Listen for these to trigger your own workflows — Slack posts, incident logs, status pages. All live in RoundlyConsulting\\Alerts\\Events:

| Event | Properties | Dispatched when |
| --- | --- | --- |
| `HealthCheckFailed` | $alert | On every failing run once failAfter() is reached — the alert is opened on the first one and reused while open. Not while muted. |
| `HealthCheckRecovered` | $alert | When recoverAfter() consecutive successes close an open alert — once per recovery, even when two runs overlap. Not while muted (the alert still closes). |
| `HealthCheckEscalated` | $alert, $fromLevel, $toLevel | Exactly once each time an open alert reaches a new escalation level. Not while muted. |

```php
use Illuminate\Support\Facades\Event;
use RoundlyConsulting\Alerts\Events\HealthCheckFailed;
use RoundlyConsulting\Alerts\Events\HealthCheckRecovered;

Event::listen(function (HealthCheckFailed $event) {
    $alert = $event->alert; // the open Alert: status, message, meta, notifiable, healthCheck
});

Event::listen(function (HealthCheckRecovered $event) {
    $minutesDown = $event->alert->triggered_at->diffInMinutes($event->alert->recovered_at);
    // post an all-clear to your incident channel
});
```

An open alert always reflects the latest failing result: its status and message follow it, so the status report and Health::status() never freeze on the first result. There is at most one open alert per scheduled check, even when two runs overlap.

## Notifying on recovery

No notification is sent on recovery. Send your own from a HealthCheckRecovered listener:

```php
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use RoundlyConsulting\Alerts\Events\HealthCheckRecovered;

Event::listen(function (HealthCheckRecovered $event): void {
    $event->alert->healthCheck?->forEachNotifiable(
        fn (object $notifiable) => Notification::send($notifiable, new CheckRecoveredNotification($event->alert)),
    );
});
```

The events use SerializesModels, so queued listeners receive a fresh Alert.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/alerts-for-laravel.md)
