shuvroroy/filament-spatie-laravel-health
Pros:
Cons:
DatabaseHealthCheck, QueueHealthCheck).composer require shuvroroy/filament-spatie-laravel-health
php artisan vendor:publish --provider="ShuvroRoy\FilamentSpatieHealth\FilamentSpatieHealthServiceProvider"
App\Providers\AppServiceProvider (using Spatie’s syntax).use Spatie\Health\Checks\Checks\DatabaseHealthCheck;
use Spatie\Health\Checks\Checks\QueueHealthCheck;
public function boot(): void
{
Health::checks([
DatabaseHealthCheck::new(),
QueueHealthCheck::new(),
]);
}
HealthCheck class.use Spatie\Health\Checks\HealthCheck;
class CustomApiHealthCheck extends HealthCheck
{
public function performCheck(Result $result): void
{
$response = Http::get('https://api.example.com/health');
if ($response->successful()) {
$result->markAsHealthy();
} else {
$result->markAsUnhealthy();
}
}
}
HealthCheckLogger.php artisan health:checks to run checks via CLI.spatie/laravel-health.HealthCheckLogger.Health::logger(function (Result $result) {
Log::channel('sentry')->error('Health check failed', [
'check' => $result->check->name(),
'message' => $result->message(),
]);
});
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Filament version incompatibility | Dashboard breaks | Pin Filament version in composer.json |
| Health check fails silently | Undetected application issues | Configure Health::failWhenChecksFail() |
| Database/queue overload | False positives in health checks | Adjust check thresholds or frequency |
| Custom check errors | Dashboard errors | Wrap checks in try-catch blocks |
How can I help you explore Laravel packages today?