Giter Site home page Giter Site logo

ihsandevs / filament-spatie-laravel-health Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shuvroroy/filament-spatie-laravel-health

0.0 0.0 0.0 257 KB

Monitor the health of a Laravel application

License: MIT License

JavaScript 2.77% PHP 61.84% CSS 0.47% Blade 34.92%

filament-spatie-laravel-health's Introduction

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.

Screenshot 2023-08-04 at 10 06 01 PM

Support For This Project

Buy Me A Coffee

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\Pages\HealthCheckResults;

class AdminPanelProvider extends PanelProvider
{
   public function panel(Panel $panel): Panel
   {
       return $panel
           // ...
           ->plugin(HealthCheckResults::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 App\Filament\Pages\HealthCheckResults;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                HealthCheckResults::make()
                    ->usingPage(HealthCheckResults::class)
            );
    }
}

Upgrading

Please see UPGRADING 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.

filament-spatie-laravel-health's People

Contributors

datlechin avatar dependabot[bot] avatar github-actions[bot] avatar joaoprado avatar mabdullahsari avatar mohamedsabil83 avatar morganchorlton3 avatar ngfw avatar shuvroroy avatar trk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.