Installation
Require the package. The service provider and the Health facade alias are auto-discovered — no manual registration:
composer require roundly-consulting/alerts-for-laravelIf 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:
php artisan vendor:publish --tag="alerts-migrations"
php artisan migratePublish-only migrations
The package never registers its migrations with the migrator, so php artisan migrate runs exactly the files you published, in the order they were published: health_checks first, then alerts, alert_silences and health_check_runs. Publishing again is idempotent — it overwrites in place rather than dropping a second copy.
Optional: config and translations
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. Translations land in lang/vendor/alerts.
Quick start
Register a check, attach it to an owner model, and let the scheduler do the rest:
// 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 cryptoBy donating, you agree to our donation terms.
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.