Manage each site's checks with the PHP SDK

This page will get you started managing the Oh Dear! checks per site, with the PHP SDK. Make sure you've read the getting started guide first. Once that's done, you should have our package & authentication ready to go.

Get all checks per site

The simplest example is one where we list all your checks for a particular site. First, make sure you retrieve the sites via the SDK.

You can get all checks of a site with the checks property.

$checks = $site->checks;

This will return an array with instances of OhDear\PhpSdk\Resources\Check.

$check->id; // returns the id
$check->type; // returns the check type eg. 'uptime' or 'mixed-content'

Each OhDear\PhpSdk\Resources\Check instance has several methods you can call.

Disabling a check

If you want to disable a check just call disable on it.

$check->disable(); // OhDear will not run the check anymore

Enabling a check

If you want to enable the check just call enable on it.

$check->enable(); // back in business

Requesting a new run

If you want Oh Dear! to perform a specific check now, call the requestRun() method.

$check->requestRun(); // OhDear will perform the check in a bit

It'll be added to the queue and checked instantly.