PHP code example of rareloop / lumberjack-sitehealth

1. Go to this page and download the library: Download rareloop/lumberjack-sitehealth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rareloop / lumberjack-sitehealth example snippets


'providers' => [
    ...

    Rareloop\Lumberjack\SiteHealth\SiteHealthServiceProvider::class,

    ...
],

return [
    'checks' => [
        \App\SiteHealth\MyCustomCheck::class,
    ],
];



namespace App\SiteHealth;

use Rareloop\Lumberjack\SiteHealth\HealthCheck;

class MyCustomCheck extends HealthCheck
{
    public function identifier(): string
    {
        return 'my-custom-check';
    }

    public function label(): string
    {
        return __('My Custom Check');
    }

    public function execute(): array
    {
        return [
            'label' => 'My custom function test',
            'description' => 'The callback to this test worked',
            'badge' => [
                'label' => 'Performance',
                'color' = 'blue',
            ],
            'status' => 'good', // 'good'|'recommended'|'critical'
            'test' => $this->identifier(),
        ];
    }
}

public function type()
{
    return static::DIRECT;
}