<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
shuvroroy / filament-spatie-laravel-health example snippets
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());
}
}
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(),
]);
}
}
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';
}
}
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)
);
}
}