PHP code example of cleaniquecoders / app-pulse

1. Go to this page and download the library: Download cleaniquecoders/app-pulse 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/ */

    

cleaniquecoders / app-pulse example snippets


use CleaniqueCoders\AppPulse\Models\Monitor;

$monitor = Monitor::create([
    'owner_type' => \App\Models\User::class,
    'owner_id' => auth()->id(),
    'url' => 'https://example.com',
    'interval' => 10, // Check every 10 minutes
    'ssl_check' => true,
]);

// In EventServiceProvider
protected $listen = [
    \CleaniqueCoders\AppPulse\Events\MonitorUptimeChanged::class => [
        \App\Listeners\SendUptimeAlert::class,
    ],
    \CleaniqueCoders\AppPulse\Events\SslStatusChanged::class => [
        \App\Listeners\SendSslAlert::class,
    ],
];
bash
php artisan vendor:publish --tag="app-pulse-config"
php artisan vendor:publish --tag="app-pulse-migrations"
php artisan migrate
bash
php artisan monitor:check-status