Search by

illuma-law / healthcheck-migration

miguelenes

Focused migration backlog health check for Spatie's Laravel Health package.

Package info

github.com/eloquage/healthcheck-migration

Language:Blade

pkg:composer/illuma-law/healthcheck-migration

Fund package maintenance!

illuma-law

Statistics

Installs: 64

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.1.5 2026-10-23 13:37 UTC

README

Healthcheck Migration banner

Tests Latest Stable Version License

A Spatie Laravel Health check that lists pending database migrations and reports whether Artisan could read migration status.

Requirements

  • PHP 8.3 or later
  • Laravel 12 or 13
  • spatie/laravel-health 1.39 or later

Installation

composer require illuma-law/healthcheck-migration

Laravel discovers the service provider automatically. To customize whether pending migrations warn or fail, publish the configuration:

php artisan vendor:publish --tag=healthcheck-migration-config

By default, pending migrations produce a warning. Set HEALTH_MIGRATION_REQUIRED=true to make a pending backlog fail the check. If Laravel cannot read migration status, the check always fails.

Usage

Register the check in your health service provider:

use IllumaLaw\HealthCheckMigration\MigrationBacklogCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    MigrationBacklogCheck::new(),
]);

The result includes pending_count and up to eight pending migration rows in its metadata. No pending migrations returns OK, pending migrations return Warning by default or Failed when required, and an Artisan/database error returns Failed.

Testing

composer test
composer analyse
vendor/bin/pint --test

License

MIT. See LICENSE.md.