PHPackages                             infinitypaul/laravel-uptime - 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. [CLI &amp; Console](/categories/cli)
4. /
5. infinitypaul/laravel-uptime

ActiveLibrary[CLI &amp; Console](/categories/cli)

infinitypaul/laravel-uptime
===========================

Keep track of critical endpoints with this command-line uptime monitor. Add an endpoint, set a frequency and listen to an event if something goes down.

1.0.0(5y ago)7222MITPHPPHP &gt;=5.5.9

Since Aug 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/infinitypaul/laravel-uptime)[ Packagist](https://packagist.org/packages/infinitypaul/laravel-uptime)[ Docs](https://github.com/infinitypaul/laravel-uptime)[ RSS](/packages/infinitypaul-laravel-uptime/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel Uptime - Stay Up And Running
====================================

[](#laravel-uptime---stay-up-and-running)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3a07d7ee0c963a10960156c88c613672eed7d2512153a135eb4a87b4cfce8f6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e66696e6974797061756c2f6c61726176656c2d757074696d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/infinitypaul/laravel-uptime)[![Build Status](https://camo.githubusercontent.com/bde6850ea4d89887da03235f369207d11ca653e0ad348754e66708471367ac3d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e66696e6974797061756c2f6c61726176656c2d757074696d652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/infinitypaul/laravel-uptime)[![Quality Score](https://camo.githubusercontent.com/995ff09c9efce9dedd28bbc921cd0c93cfe0732e35a5af34721b806d91149018/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e66696e6974797061756c2f6c61726176656c2d757074696d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/infinitypaul/laravel-uptime)[![Total Downloads](https://camo.githubusercontent.com/8d69433ea2926cf5835f0c75691c5addd9fd3f7cb93cbe354e9274385fab1e66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e66696e6974797061756c2f6c61726176656c2d757074696d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/infinitypaul/laravel-uptime)

Keep track of critical endpoints with this command-line uptime monitor. Add an endpoint, set a frequency and listen to an event if something goes down.

[![](https://raw.githubusercontent.com/infinitypaul/laravel-uptime/master/screen.jpeg)](https://raw.githubusercontent.com/infinitypaul/laravel-uptime/master/screen.jpeg)

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

[](#installation)

You can install the package via composer:

```
composer require infinitypaul/laravel-uptime
```

Configuration
-------------

[](#configuration)

To publish Uptime's configuration and migration files, run the vendor:publish command.

```
php artisan vendor:publish --provider="Infinitypaul\LaravelUptime\LaravelUptimeServiceProvider"
```

This will create a uptime.php in your config directory. The default configuration should work just fine for you, but you can take a look at it, if you want to customize the table / model names Uptime will use

Run the migration command, to generate all tables needed for Uptime.

```
php artisan migrate

```

After the migration, 2 new tables will be created:

- endpoints - stores endpoint records
- statuses - store the ping status of the endpoint

### Commands

[](#commands)

Once Package is Installed, The Following Commands Will Be Available To You

CommandDescriptionsArgumentOptionsendpoint:addAdd An Endpoint To Monitorurl eg: Frequency in Minutes eg 20, default is 5endpoint:removeRemove An Endpointid of the end endpoint eg 2nulluptime:statusDisplay The Status Of All Endpointnullforce : check for the status of the endpoint and display as welluptime:runRun The Whole Endpoint To Get Statusnullforce : get an immediate response of the endpoint irrespective of the minutesAdd An Endpoint
---------------

[](#add-an-endpoint)

```
 php artisan endpoint:add https://infinitypaul.com -f 5
```

Add Infinitypaul.com as a frequency of 5

```
 php artisan endpoint:add own -f 5
```

Add The Base URL of your laravel project

Display All Endpoint
--------------------

[](#display-all-endpoint)

```
php artisan uptime:status
```

Display All the Endpoint And Status In A Beautiful Table

```
php artisan uptime:status --force
```

Check The Status Of The Endpoint Irrespective Of Their Frequency And Display As Well

Remove An Endpoint
------------------

[](#remove-an-endpoint)

```
php artisan endpoint:remove
```

Remove An Endpoint From The List Of EndPoint To Be Monitored

Ping All Endpoint
-----------------

[](#ping-all-endpoint)

```
php artisan uptime:run
```

Ping All The Endpoint And Get The Up Or Down Status In Order Of Their Frequency

```
php artisan uptime:run --force
```

Ping All The Endpoint And Get The Up Or Down Status Irrespective Of Their Frequency

### Scheduling

[](#scheduling)

You can add the run command in your task scheduling to run every minute

```
php artisan uptime:run

```

### Endpoints Down/Up Events

[](#endpoints-downup-events)

If you need to run additional processes when an endpoint is down or back up, you can Listen for these events:

```
\Infinitypaul\LaravelUptime\Events\EndpointIsBackUp

\Infinitypaul\LaravelUptime\Events\EndpointIsDown

```

In your `EventServiceProvider` add your listener(s):

```
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    ...
    \Infinitypaul\LaravelUptime\Events\EndpointIsBackUp::class => [
        App\Listeners\URLIsBack::class,
    ],
    \Infinitypaul\LaravelUptime\Events\EndpointIsDown::class => [
        App\Listeners\YourEndPointIsDown::class,
    ],
];
```

The EndpointIsBackUp and EndpointIsDown event exposes the Endpoint and Status. In your listener, you can access them like so:

```
