illuma-law / healthcheck-migration
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!
Requires
- php: ^8.3
- illuminate/contracts: ^12.0||^13.0
- illuminate/database: ^12.0||^13.0
- illuminate/support: ^12.0||^13.0
- spatie/laravel-health: ^1.39
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- mrpunyapal/peststan: ^0.2.12
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.1.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 13:37:21 UTC
README
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-health1.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.
