illuma-law / healthcheck-storage
Focused storage health check for Spatie's Laravel Health package.
Fund package maintenance!
v0.1.2
2026-04-20 18:47 UTC
Requires
- php: ^8.3
- illuminate/contracts: ^11.0||^12.0||^13.0
- illuminate/database: ^11.0||^12.0||^13.0
- illuminate/support: ^11.0||^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
- 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
README
A focused storage health check for Spatie's Laravel Health package.
This package provides a direct health check to verify that your configured storage disks (local, S3, etc.) are actually writable by the application.
Features
- Write-Read-Delete Cycle: Performs a complete cycle (write small file, read it back, delete it) to ensure full disk operationality.
- Multi-Disk Support: Monitor multiple disks at once (defaults to
localandpublic). - Performance Tracking: Reports the latency of the storage operations for each disk in the health meta data.
Installation
Require this package with composer:
composer require illuma-law/healthcheck-storage
Usage & Integration
Register the check inside your application's health service provider (e.g. AppServiceProvider or a dedicated HealthServiceProvider), alongside your other Spatie Laravel Health checks:
Basic Registration
use IllumaLaw\HealthCheckStorage\StorageDiskWritabilityCheck; use Spatie\Health\Facades\Health; Health::checks([ StorageDiskWritabilityCheck::new() ->disks(['local', 'public', 's3']), ]);
Expected Result States
The check interacts with the Spatie Health dashboard and JSON endpoints using these states:
- Ok: All probed disks successfully completed the write-read-delete cycle.
- Skipped: No valid disks were configured or found to probe.
- Failed: One or more disks failed to write, read back, or delete the probe file.
Testing
Run the test suite:
composer test
License
The MIT License (MIT). Please see License File for more information.