---
title: "Installation — Alerts for Laravel | Roundly"
description: "Install via Composer, publish and run the publish-only migrations, and optionally publish the config and translations."
url: https://roundly-consulting.com/open-source/docs/alerts-for-laravel/installation
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)

# Installation

Require the package. The service provider and the Health facade alias are auto-discovered — no manual registration:

```bash
composer require roundly-consulting/alerts-for-laravel
```

If the models that will own health checks use UUID or ULID keys, set ALERTS\_KEY\_TYPE first — the owner columns are typed when the migrations run (see Database schema & key types). Then publish and run the migrations:

```bash
php artisan vendor:publish --tag="alerts-migrations"
php artisan migrate
```

## Publish-only migrations

The package never registers its migrations with the migrator, so php artisan migrate runs exactly the six files you published, in the order they were published: health\_checks first, then alerts, alert\_silences and health\_check\_runs, then the two additive 1.2 migrations that add identity\_hash to health\_checks and alert\_silences. Publishing again is idempotent — it overwrites in place rather than dropping a second copy.

## Upgrading to 1.2

1.2 adds two forward-only migrations. add\_identity\_hash\_to\_health\_checks\_table adds a nullable, unique health\_checks.identity\_hash, with no backfill. add\_identity\_hash\_to\_alert\_silences\_table adds a nullable, unique alert\_silences.identity\_hash; it first collapses the immediate silences already stacked per key and scope into one — the newest row, open-ended if any of them was, otherwise until the latest end, with the newest reason — so what is muted does not change. Publish and migrate again:

```bash
php artisan vendor:publish --tag="alerts-migrations"
php artisan migrate
```

If you edited a published alerts migration, vendor:publish no longer recognises it and would publish a second copy of the create migrations — copy the two new files into database/migrations by hand instead. On MySQL, 1.2 needs MySQL 8.0 or later.

- Health::report() now reads muted from the silences in force and reports uptime and p95LatencyMs as null for a check with no runs, instead of 100.0 and 0 (see Status reports & health endpoint).
- Muting the same key and scope again updates that silence instead of inserting another (see Maintenance windows & muting).
- A check that throws no longer stores or mails its exception’s message and stack frames — they go to your exception handler (see Timeouts & error handling).

## Optional: config and translations

```bash
php artisan vendor:publish --tag="alerts-config"
php artisan vendor:publish --tag="alerts-translations"
```

The config is merged from the package, so the env-backed keys work without publishing. The check messages and the default failure notification ship in English and Slovak, and Laravel picks the lines for the app locale — publish the translations (to lang/vendor/alerts) only to reword a line or add another language.

## Quick start

Register a check, attach it to an owner model, and let the scheduler do the rest:

```php
// app/Providers/AppServiceProvider.php — boot()
use RoundlyConsulting\Alerts\Checks\DatabaseCheck;
use RoundlyConsulting\Alerts\Facades\Health;

Health::check(DatabaseCheck::make('mysql'));

// Anywhere — attach the check to an owner model (see Owner models)
Health::for($team)->monitor(DatabaseCheck::class)
    ->everyFiveMinutes()
    ->throttle(maxAttempts: 1, decayMinutes: 60)
    ->save();
```

The package is built from three pieces:

- Check — a class you write (or a built-in one, or an inline closure) that performs a check and returns a CheckResult.
- HealthCheck — the database row that schedules a Check at a cron frequency for one notifiable owner.
- Alert — the row created when a health check fails, with triggered\_at, recovered\_at and the result’s message and meta.

One Artisan command, auto-registered on the scheduler to run every minute, dispatches a queued job for every health check that is due. Make sure Laravel’s scheduler and a queue worker are running (see Running checks).

## 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)
