PHPackages                             nagy/health-check - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nagy/health-check

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nagy/health-check
=================

v1.0(7y ago)561MITPHPPHP &gt;7.1

Since Sep 23Pushed 6y ago2 watchersCompare

[ Source](https://github.com/mohamednagy/health-checker)[ Packagist](https://packagist.org/packages/nagy/health-check)[ RSS](/packages/nagy-health-check/feed)WikiDiscussions master Synced 2w ago

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

health-checker
==============

[](#health-checker)

Monitor your laravel server and application health and get notified immediately.

Features
--------

[](#features)

- [Dashboard](#dashboard)
- [APIs](#APIs)
- [Artisan command](#artisan-command)
- [Schedule](#schedule)
- [Notifications](#notifications)
- [Implemented Checkers](#checkers)
    - ProcessCount
    - Expression
    - ServerAvailability
- [Custom Checkers](#custom-checkers)

Install
=======

[](#install)

```
$ composer require nagy/health-check

```

publish config files and resources

```
$ php artisan vendor:publish --provider='Nagy\HealthChecker\ServiceProvider'

```

Dashboard
---------

[](#dashboard)

[![screen shot 2018-09-22 at 15 52 53](https://user-images.githubusercontent.com/10484012/45917999-50790580-be80-11e8-9404-12d16d69db3b.png)](https://user-images.githubusercontent.com/10484012/45917999-50790580-be80-11e8-9404-12d16d69db3b.png)

APIs
----

[](#apis)

get all checkers: `http://localhost/health-check/checkers`response:

```
[
 'httpd-check',
 'app-debug'
]

```

get all check results `http://localhost/health-check`response:

```
[
    [
      'checkerName' => 'httpd-check',
      'type' => 'success',
      'message' => 'Everything is ok with the process'
    ],
    ...
]

```

get specific checker result `http://localhost/health-check/checker-name`response:

```
[
  'checkerName' => 'httpd-check',
  'type' => 'success',
  'message' => 'Everything is ok with the process'
]

```

Artisan Command
---------------

[](#artisan-command)

[![screen shot 2018-09-22 at 15 55 16](https://user-images.githubusercontent.com/10484012/45917998-4fe06f00-be80-11e8-8d5b-ac54857a9586.png)](https://user-images.githubusercontent.com/10484012/45917998-4fe06f00-be80-11e8-8d5b-ac54857a9586.png)

Schedule
--------

[](#schedule)

Package will run peridcally in the background to check you application and server health. the frequency is being set based on the [laravel frequency options](https://laravel.com/docs/5.6/scheduling#schedule-frequency-options)

Notifications
-------------

[](#notifications)

First the package is enabled by checking `notifications => [ 'enabled' => true]` in the configuration file, then check if the result type is exists on `notifications => 'notify_on' `The current suporrted notification channels is `MailChannel`, you can add your custom channel by creating a class with a *notify* method. The *notify* method accepts a collection of results.

```
class CustomChannel
{
    public function notify(Collection $results)
    {
        //
    }
}

```

Checkers
--------

[](#checkers)

The package shipped with two global checkers

### ProcessCount

[](#processcount)

used to check the count of running process, for exampl, you need to check that at least a 10 workers are ruuning, then add a new elemet to the `checkers` in the configuration file

```
checkers => [
    'app-workers' => [
            'class' => '\Nagy\HealthChecker\Checkers\ProcessCount',
            'options' => ['processName' => 'app-workers', 'min' => 10, max => 20]
        ],
]

```

> **Note**The package consider the checker key as the checker name, so it's highly recommend to name avoid the spaces in the checker name.

### Expression

[](#expression)

Expression checker evalutes a Specfic expression, the evalution should be `true` to consider the it as healthy.

```
'app-debug' => [
     'class' => Expression::class,
     'options' => ['expression' => 'env("APP_DEBUG") == true']
]

```

### ServerAvailability

[](#serveravailability)

Check if the provided `host` is accessable via a specific port *(port is optional, default is 80)*

```
'mysql' => [
    'class' => ServerAvailability::class,
    'options' => ['host' => env('DB_HOST'), 'port' => env('DB_PORT')]
]

```

Custom Checkers
---------------

[](#custom-checkers)

in case you need to build your own checkers then all you need to do is creating a class that extends from `AbstractBaseChecker` and implements `HealthCheckInterface`. then you have to implement methods `check`, `isHealthy` and `getMessage`

```
class CustomChecker extends AbstractBaseChecker implements HealthCheckInterface
{
    public function check(): Result
    {
        if ($this->isHealthy()) {
            return $this->makeHealthyResult();
        } else {
            return $this->makeUnHealthyResult();
            // return $this->makeUnHealthyResult(Result::WARNING_STATUS);
        }
    }

    public function isHealthy(): bool
    {
        return true;
    }

    public function getMessage(): string
    {
        // return your message to be attached in case of unhealthy result
    }
}

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2836d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10484012?v=4)[Mohamed Nagy](/maintainers/mohamednagy)[@mohamednagy](https://github.com/mohamednagy)

---

Top Contributors

[![mohamednagy](https://avatars.githubusercontent.com/u/10484012?v=4)](https://github.com/mohamednagy "mohamednagy (27 commits)")

---

Tags

laravelphp

### Embed Badge

![Health badge](/badges/nagy-health-check/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M267](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M991](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M363](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)[xefi/faker-php-laravel

Faker php integration with laravel

2618.0k](/packages/xefi-faker-php-laravel)

PHPackages © 2026

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