PHP code example of yugo / filament-service-pinger

1. Go to this page and download the library: Download yugo/filament-service-pinger 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/ */

    

yugo / filament-service-pinger example snippets


use Yugo\FilamentServicePinger\ServicePingerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            new ServicePingerPlugin(),
        ]);
}

config/service-pinger.php



return [
    'models' => [
        'service' => \Yugo\FilamentServicePinger\Models\Service::class,
        'check' => \Yugo\FilamentServicePinger\Models\ServiceCheck::class,
    ],

    'jobs' => [
        'ping' => \Yugo\FilamentServicePinger\Jobs\PingServiceJob::class,
    ],

    'poll_interval' => 10,
    
    'resources' => [
        'slug' => '/services',
    ],

    'navigations' => [
        'group' => null,
        'sort' => 50,
        'icon' => 'heroicon-o-signal',
    ],
];


use Illuminate\Support\Facades\Schedule;

Schedule::command('service-pinger:run')
    ->everyMinute()
    ->withoutOverlapping();
bash
php artisan vendor:publish --tag=service-pinger-config
php artisan vendor:publish --tag=service-pinger-migrations
bash
php artisan vendor:publish --tag=service-pinger-translations
bash
php artisan migrate
bash
php artisan queue:work