1. Go to this page and download the library: Download exitprobe/laravel 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/ */
exitprobe / laravel example snippets
use ExitProbe\Laravel\Facades\ExitProbe;
// List monitors that are currently down
$monitors = ExitProbe::monitors()->list(['status' => 'down']);
// Create a project, then a monitor inside it
$project = ExitProbe::projects()->create(['name' => 'Production']);
$created = ExitProbe::monitors()->createForProject($project['data']['project']['id'], [
'name' => 'EU Exit Node',
'expected_exit_ip' => '203.0.113.45',
'wireguard_enabled' => true,
'wireguard_config' => "[Interface]\nPrivateKey=...",
]);
// Trigger an on-demand check, then poll it
$dispatched = ExitProbe::monitors()->checkNow($created['data']['monitor']['id']);
ExitProbe::monitors()->checkStatus($created['data']['monitor']['id'], $dispatched['data']['check_ids']);
// Uptime history and full analytics
ExitProbe::monitors()->uptime($created['data']['monitor']['id'], ['range' => '7d']);
ExitProbe::monitors()->analytics($created['data']['monitor']['id'], ['range' => '30d']);