exitprobe / laravel
Official Laravel client for the ExitProbe API — manage projects, monitors, checks, uptime and analytics.
Requires
- php: ^8.1
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-27 00:03:40 UTC
README
Official Laravel client for the ExitProbe API. Manage projects and monitors, trigger checks, and read uptime/analytics from your own Laravel app — no HTTP boilerplate.
Install
composer require exitprobe/laravel
The service provider and ExitProbe facade are auto-discovered. Publish the config if you want to tweak defaults:
php artisan vendor:publish --tag=exitprobe-config
Then set your API token (Settings → API Tokens on your ExitProbe dashboard):
EXITPROBE_API_KEY=ep_live_...
Quick start
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']);
Or resolve ExitProbe\Laravel\ExitProbeClient from the container / inject it, if you'd rather not use the facade.
Error handling
Every non-2xx response throws ExitProbe\Laravel\ExitProbeException, which carries the HTTP status and, for a 422, the field-level validation errors:
use ExitProbe\Laravel\ExitProbeException; try { ExitProbe::monitors()->create(['name' => '']); } catch (ExitProbeException $e) { report($e); // $e->status, $e->errors, $e->getMessage() }
API surface
ExitProbe::projects()—list,create,get,update,delete,restore,regenerateKey,clearChecks,monitorsExitProbe::monitors()—list,create,createForProject,get,update,delete,restore,checkNow,checkStatus,checks,clearChecks,uptime,uptimeRegions,analytics,status
Every method mirrors an endpoint documented at /api-docs on your ExitProbe dashboard — see there for full request/response shapes. Every method returns the API's decoded JSON body as an associative array (['success' => ..., 'data' => [...]]).
Configuration
config/exitprobe.php:
return [ 'api_key' => env('EXITPROBE_API_KEY'), 'base_url' => env('EXITPROBE_BASE_URL', 'https://app.exitprobe.com/api/v1'), 'timeout' => env('EXITPROBE_TIMEOUT', 30), ];
Testing
This package ships its own PHPUnit suite built on Orchestra Testbench and Http::fake():
composer install vendor/bin/phpunit
Publishing
Not published yet. Once this repo is pushed to GitHub:
- Create a Packagist account and submit this repo's URL —
composer.jsonis at the repo root, so Packagist picks it up directly. - Set up the GitHub webhook Packagist gives you, so new tags auto-publish.
git tag v1.0.0 && git push --tagsfor the first release; repeat for future versions.
License
MIT