Monitor the health of a Laravel application
Monitor the health of a Laravel application
This package adds a Filament page for monitoring checks registered with spatie/laravel-health. It supports Filament 4 and 5 and PHP 8.2 or newer.
Install the package via Composer:
composer require shuvroroy/filament-spatie-laravel-healthLaravel Health can store results in various ways. If you use its default Eloquent result store, publish and run the migration that creates the health_check_result_history_items table:
php artisan vendor:publish --tag="health-migrations"
php artisan migratePublish Filament's assets:
php artisan filament:assetsRegister the plugin in your Filament panel provider, such as AdminPanelProvider:
plugin(FilamentSpatieLaravelHealthPlugin::make());
}
}Register your health checks in the boot() method of app/Providers/AppServiceProvider.php:
navigationGroup('System')
->navigationSort(10)
->navigationIcon('heroicon-o-cpu-chip')
->navigationLabel('Application Health');Pass null to navigationGroup() to remove the default navigation group. Pass null to navigationLabel() to use the translated default label.
Extend the default page when you need to customise page-specific behavior, such as its heading or view. Configure navigation through the plugin methods described above.
plugin(
FilamentSpatieLaravelHealthPlugin::make()
->usingPage(HealthCheckResults::class),
);
}
}The page is accessible by default. Pass a boolean or closure to authorize() to restrict access:
plugin(
FilamentSpatieLaravelHealthPlugin::make()
->authorize(fn (): bool => auth()->user()?->email === '[email protected]'),
);
}
}Please see UPGRADE for details on how to upgrade 1.X to 2.0.
composer test
composer test:coverage
composer analyse
composer formatThe coverage command requires Xdebug or PCOV and fails when coverage is below 100%.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
No open issues yet, or sync has not completed.