Spatie Laravel Health
CommunityThis package provides a Filament page that you can monitor the health of your application by registering checks using the `spatie/laravel-health` package.
Author:
Shuvro Roy
Package health
BetaAutomated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Warning: Dependabot or Renovate configured — Updater does not cover the JavaScript ecosystem, which has a committed lockfile.
-
Failed:
Dependency update cooldown configured
—
No cooldown configured in
.github/dependabot.yml. View details on Plumb - Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 26 days ago; last release 42 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Passed:
Current Laravel version supported
—
Package dependencies resolve together with current Laravel
13.0. -
Passed:
Current PHP version supported
—
Constraint
^8.2supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
- Installation
- Usage
- Customising who can access the page
- Upgrading
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
This package provides a Filament page that you can monitor the health of your application by registering checks using the spatie/laravel-health package.
#Installation
You can install the package via composer:
composer require shuvroroy/filament-spatie-laravel-health
This package can store health check results in various ways. When using the EloquentHealthResultStore the check results will be stored in the database. To create the health_check_result_history_items table, you must create and run the migration.
php artisan vendor:publish --tag="health-migrations"
php artisan migrate
Publish the package's assets:
php artisan filament:assets
#Usage
You first need to register the plugin with Filament. This can be done inside of your PanelProvider, e.g. AdminPanelProvider.
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelHealth\FilamentSpatieLaravelHealthPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(FilamentSpatieLaravelHealthPlugin::make());
}
}
Then register Health::checks on app/Providers/AppServiceProvider.php -> boot method
<?php
namespace App\Providers;
use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\OptimizedAppCheck;
use Spatie\Health\Checks\Checks\DebugModeCheck;
use Spatie\Health\Checks\Checks\EnvironmentCheck;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Health::checks([
OptimizedAppCheck::new(),
DebugModeCheck::new(),
EnvironmentCheck::new(),
]);
}
}
Read the full documentation on Spatie Laravel Health
If you want to override the default HealthCheckResults page icon, heading then you can extend the page class and override the navigationIcon property and getHeading method and so on.
<?php
namespace App\Filament\Pages;
use ShuvroRoy\FilamentSpatieLaravelHealth\Pages\HealthCheckResults as BaseHealthCheckResults;
class HealthCheckResults extends BaseHealthCheckResults
{
protected static ?string $navigationIcon = 'heroicon-o-cpu-chip';
public function getHeading(): string | Htmlable
{
return 'Health Check Results';
}
public static function getNavigationGroup(): ?string
{
return 'Core';
}
}
Then register the extended page class on AdminPanelProvider class.
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelHealth\FilamentSpatieLaravelHealthPlugin;
use App\Filament\Pages\HealthCheckResults;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
FilamentSpatieLaravelHealthPlugin::make()
->usingPage(HealthCheckResults::class)
);
}
}
#Customising who can access the page
You can customise who can access the Health page by adding an authorize method to the plugin.
The method should return a boolean indicating whether the user is authorised to access the page.
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use ShuvroRoy\FilamentSpatieLaravelHealth\FilamentSpatieLaravelHealthPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
FilamentSpatieLaravelHealthPlugin::make()
->authorize(fn (): bool => auth()->user()->email === 'admin@example.com'),
);
}
}
#Upgrading
Please see UPGRADE for details on how to upgrade 1.X to 2.0.
#Testing
composer test
#Changelog
Please see CHANGELOG for more information on what has changed recently.
#Contributing
Please see CONTRIBUTING for details.
#Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
#Credits
#License
The MIT License (MIT). Please see License File for more information.
The author
Shuvro is a senior software engineer from Dhaka, BD. He contributes to Filament and lots of other open source projects. He works for MailerLite, a digital email marketing platform.
From the same author
Featured Plugins
A selection of plugins curated by the Filament team
Blueprint
Filament Blueprint is a premium Laravel Boost extension that helps AI agents produce accurate, detailed implementation plans and security reports for Filament apps.
Filament
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight/Raycast like Command Palette to your Filament Panel.
Dennis Koch
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament