PHPackages                             phpsafari/health-checks - 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. phpsafari/health-checks

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

phpsafari/health-checks
=======================

Make health checks in your laravel application

v0.0.7(8y ago)3713.2k↓80%10[3 issues](https://github.com/phpsafari/health-checks/issues)[3 PRs](https://github.com/phpsafari/health-checks/pulls)MITPHPPHP &gt;=7.0.0CI failing

Since Feb 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/phpsafari/health-checks)[ Packagist](https://packagist.org/packages/phpsafari/health-checks)[ RSS](/packages/phpsafari-health-checks/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (7)Versions (9)Used By (0)

Health Checks
=============

[](#health-checks)

[![Build Status](https://camo.githubusercontent.com/55379547f4b99d2eb256267ee96f9f30f1fb3842ad69f2dc7c7169c4e29d13cc/68747470733a2f2f7472617669732d63692e6f72672f7068707361666172692f6865616c74682d636865636b732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phpsafari/health-checks)

Add health checks to your Laravel applications with this package.

Examples
--------

[](#examples)

[![All passed](/img/passed.png "Health checks via commandline")](/img/passed.png)[![DB failed](/img/db-not-up-to-date.png "Database is not up-to-date")](/img/db-not-up-to-date.png)[![Queue failed](/img/queue-not-processing.png "Queue is not processing")](/img/queue-not-processing.png)[![Url stats](/img/health-stats.png "Health checks stats via URL")](/img/health-stats.png)

Install
-------

[](#install)

First, use Composer to install this package.

```
$ composer require phpsafari/health-checks
```

After the package has been installed, go ahead and add ``PhpSafari\\ServiceProvider\\HealthCheckServiceProvider::class`to your`config/app.php` file.

After doing this, you can publish the `health.php` configuration file into your `config` folder by running:

```
$ php artisan vendor:publish --tag=health
```

Usage
-----

[](#usage)

Inside the `config/health.php` file is where you configure all your available health checks. By default, this package comes packed with a few checks already:

- `CorrectEnvironment` will check if your application's environment is set to `production`
- `DatabaseOnline` will check your database connection
- `DatabaseUpToDate` will check if your application has any migrations that hasn't been migrated yet
- `DebugModeOff` will check if debug mode is off
- `QueueProcessing` will check if the queue is running and jobs are getting processed
- `PathIsWritable` will check if a provided path is writable
- `LogLevel` will check if log level is set to the given value
- `MaxRatioOf500Responses` will check if the ratio of 500 response are above a given threshold (The last 60 min)
- `MaxResponseTimeAvg` will check if average response time for all request are above a given threshold (The last 60 min)

To run a health check of your application, run:

```
$ php artisan health:check
```

You can also use Laravel's scheduler to schedule your health checks:

```
$schedule->command('health:check')->hourly();
```

### Url based health checks

[](#url-based-health-checks)

You can also run a health check by hitting the `https:///_health` url in a browser or with a tool like Pingdom.

**Note:** \_This feature can be disabled in the `config/health.php` file, by setting `route.enabled` to `false`.

You can navigate to `https:///_health/stats` and get all stats, including avg response time,

### Creating your own health checks

[](#creating-your-own-health-checks)

In order to create your own health checks, you just need to extend the `PhpSafari\Checks\HealthCheck` class and implement the `run()` method.

**Example:**

```
class IsFriday extends PhpSafari\Checks\HealthCheck
{
    public function run(): bool
    {
        return Carbon::now()->isFriday();
    }
}
```

Then add `new IsFriday()` to the list of checks in `config/health.php`.

Testing
-------

[](#testing)

```
$ phpunit tests/
```

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Visti Kløft](https://github.com/vistik)
- [Peter Suhm](https://github.com/petersuhm)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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 ~49 days

Recently: every ~74 days

Total

7

Last Release

3077d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/778d5a66387a519744a13323544a11649c3c52bdb7207319c473a4154ce5335f?d=identicon)[vistik](/maintainers/vistik)

---

Top Contributors

[![vistik](https://avatars.githubusercontent.com/u/354169?v=4)](https://github.com/vistik "vistik (106 commits)")[![petersuhm](https://avatars.githubusercontent.com/u/1430546?v=4)](https://github.com/petersuhm "petersuhm (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/phpsafari-health-checks/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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