PHPackages                             gbradley/updown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. gbradley/updown

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

gbradley/updown
===============

Easy integration with Updown.io

v1.1.2(5y ago)529.2k↓47.5%2[1 PRs](https://github.com/gbradley/updown/pulls)MITPHPPHP &gt;=7.1.0

Since Dec 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gbradley/updown)[ Packagist](https://packagist.org/packages/gbradley/updown)[ Docs](https://github.com/gbradley/updown)[ RSS](/packages/gbradley-updown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

Updown
======

[](#updown)

A PHP library for the [updown.io](https://updown.io) website monitoring API. Create, inspect, modify and delete checks, with optional Laravel integration.

```
$check = $updown->create('https://mysite.com', [
	'alias' 	=> 'MySite',
	'period'	=> 60,
]);

...

$check->delete();

```

- [Requirements](#requirements)
- [Installation](#installation)
- [Setup](#setup)
- [Usage](#usage)
- [Laravel integration](#laravel-integration)

Requirements
------------

[](#requirements)

Updown requires PHP 7.1 or above. The optional Laravel integration requires 5.5 or above.

Installation
------------

[](#installation)

Install with Composer:

```
$ composer require gbradley/updown

```

Setup
-----

[](#setup)

Configure an instance of the updown client by passing in your API key. If the running application is checked by updown.io, you can provide its token in the second argument.

```
use GBradley\Updown\Client;
...
$updown = new Client('my-api-key', 'my-app-token');
// do stuff

```

Usage
-----

[](#usage)

The Client is used to fetch and obtain Check instances, which allow you to inspect, modify and delete a single check. If the library encounters a problem, a `GBradley\Updown\ApiException` will be thrown, providing error information from the API response where possible.

### Client

[](#client)

- [checks()](#checks)
- [create()](#create)
- [check()](#check)
- [ips()](#ips)

#### checks()

[](#checks)

Returns an array of `Gbradley\Updown\Check`s, keyed by their token.

```
$checks = $updown->checks();
$checks['abcd']->alias;			// 'MySite'

```

#### create()

[](#create)

Creates a new check. Pass the URL to be checked as the first argument; you can provide any of the [documented options](https://updown.io/api#rest) in an array as the second argument.

```
$check = $updown->create('https://yoursite.com', [
	'alias'	=> 'YourSite',
]);
$check->token;				// 'abzy'

```

#### check()

[](#check)

Retrieve a Check object matching the provided token. If none is provided, the configured app token is used instead.

```
$check = $updown->check('abzy');
$check->alias;				// 'YourSite'

```

#### ips()

[](#ips)

Retrieve a list of all the IPs used to perform checks. You may specify the IP version in the first argument; defaults to 4.

### Check

[](#check-1)

- [getters &amp; setters](#getters--setters)
- [data()](#data)
- [save()](#save)
- [enable()](#enable)
- [disable()](#disable)
- [downtimes()](#downtimes)
- [metrics()](#metrics)
- [delete()](#delete)

#### Getters &amp; setters

[](#getters--setters)

To get a Check's data, just access the relevant property:

```
$check->alias;				// 'MySite'

```

To set data on a Check, assign the value to the property:

```
$check->alias = 'MySite';

```

**Note that changes via setters will not be applied until you call save().**

#### data()

[](#data)

You may also retrieve all data held about a check with the `data()` method. This will return an associative array.

#### save()

[](#save)

Applies any changes made to the check. You may provide an additional array of changes to this method.

```
$check->alias = 'MySite';
$check->save([
	'period'	=> 120,
]);

```

#### enable()

[](#enable)

Enables the check.

#### disable()

[](#disable)

Disables the check.

#### downtimes()

[](#downtimes)

Returns an array of downtime information for the check; you can provide any of the [documented options](https://updown.io/api#rest) in an array as the second argument.

#### metrics()

[](#metrics)

Returns an array of metrics for the check; you can provide any of the [documented options](https://updown.io/api#rest) in an array as the second argument.

#### delete()

[](#delete)

Deletes the check.

Laravel integration
-------------------

[](#laravel-integration)

If you use Laravel, the package can assist you by auto-resolving a client, disabling checks while in maintenance mode, and listening for events via webhooks.

- [Config](#config)
- [Service Provider](#service-provider)
- [Maintenance mode](#maintenance-mode)
- [Webhooks](#webhooks)

### Config

[](#config)

Start by publishing the config file:

```
$ php artisan vendor:publish --Provider=Gbradley\Updown\Laravel\ServiceProvider

```

By default, `config/updown.php` attempts to read `UPDOWN_API_KEY` and `UPDOWN_APP_TOKEN` from your `.env` file.

### Service Provider

[](#service-provider)

The ServiceProvider will be automatically detected, and configures a client singleton using the credentials from the config. You may resolve the client from the container or via dependency injection.

```
use GBradley\Updown\Client;
...
public function handle(Client $updown)
{
	// do stuff
}

```

### Maintenance mode

[](#maintenance-mode)

If your application is checked by updown.io, you'll want to avoid running that check during mainenance. Provided your app token is set, the package will automatically disable the check when you run the `artisan down` command, and enable it again after `artisan up`.

If you wish to disable this behaviour, you can do so in the config file.

### Webhooks

[](#webhooks)

To respond to updown.io's webhooks, enable webhooks in `config/updown.php`. The webhook URI is set to a sensible default, but you may change it if you wish. If you use config and / or route caching, you should refresh these caches now.

Next, go to your [updown.io settings](https://updown.io/settings/edit) and add the webhook using its full address. Your application will now begin to accept webhook requests, so all that's left is to handle the relevent events.

#### Listeners

[](#listeners)

To listen for the events, [create and register a Listener](https://laravel.com/docs/5.7/events#registering-events-and-listeners) for the `GBradley\Updown\Laravel\Events\Down` &amp; `GBradley\Updown\Laravel\Events\Up` events.

```
protected $listen = [
    'GBradley\Updown\Laravel\Events\Down' => ['App\Listeners\Down'],
    'GBradley\Updown\Laravel\Events\Up' => ['App\Listeners\Up'],
];

```

When updown.io sends a request to your webhook, the appropriate listener will receive an event with `check` and `downtime` properties.

```
public function handle(Down $event)
{
	$evnt->check->alias;	// 'MySite'
}

```

#### Broadcasting

[](#broadcasting)

If you wish to [broadcast](https://laravel.com/docs/5.7/broadcasting) the `Up` &amp; `Down` events, perhaps to your front-end, you may subclass them and specify the custom classes in `config/updown.php`.

```
use GBradley\Updown\Laravel\Events\Down as BaseDown;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class Down extends BaseDown implements ShouldBroadcast
{
    ...
}

```

You may now follow the standard Laravel procedure for broadcasting to your channels.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~131 days

Recently: every ~164 days

Total

6

Last Release

2063d ago

Major Versions

v0.1.1 → v1.0.02018-12-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/116627?v=4)[Graham Bradley](/maintainers/gbradley)[@gbradley](https://github.com/gbradley)

---

Top Contributors

[![gbradley](https://avatars.githubusercontent.com/u/116627?v=4)](https://github.com/gbradley "gbradley (13 commits)")

---

Tags

monitoringupdown

### Embed Badge

![Health badge](/badges/gbradley-updown/health.svg)

```
[![Health](https://phpackages.com/badges/gbradley-updown/health.svg)](https://phpackages.com/packages/gbradley-updown)
```

###  Alternatives

[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[liip/monitor-bundle

Liip Monitor Bundle

4728.7M16](/packages/liip-monitor-bundle)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19024.6M15](/packages/datadog-php-datadogstatsd)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2332.0M2](/packages/inspector-apm-inspector-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
