shuvroroy / filament-spatie-laravel-health by shuvroroy

This plugin is built on top of Spatie's Laravel-health package
188,476
161
2
Package Data
Maintainer Username: shuvroroy
Maintainer Contact: shuvro.nsu.cse@gmail.com (Shuvro Roy)
Package Create Date: 2021-12-29
Package Last Update: 2024-10-20
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-09 15:09:54
Package Statistics
Total Downloads: 188,476
Monthly Downloads: 11,279
Daily Downloads: 289
Total Stars: 161
Total Watchers: 2
Total Forks: 25
Total Open Issues: 4

Filament Spatie Laravel Health

PHP Version Require GitHub Tests Action Status Latest Stable Version Total Downloads 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.

Health Check Results - Filament Demo

Support For This Project

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

You can publish the config file with:

php artisan vendor:publish --tag="filament-spatie-health-config"

This is the contents of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | Pages
    |--------------------------------------------------------------------------
    |
    | This is the configuration for the general appearance of the page
    | in admin panel.
    |
    */

    'pages' => [
        'health' => \ShuvroRoy\FilamentSpatieLaravelHealth\Pages\HealthCheckResults::class
    ],

];

Usage

This package will automatically register the HealthCheckResults. You'll be able to see it when you visit your Filament admin panel.

Defining Resources to health check

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()
    {
        Health::checks([
            OptimizedAppCheck::new(),
            DebugModeCheck::new(),
            EnvironmentCheck::new(),
        ]);
    }
}

Read the full documentation on Spatie Laravel Health

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.