PHPackages                             govigilant/laravel-healthchecks - 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. govigilant/laravel-healthchecks

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

govigilant/laravel-healthchecks
===============================

A Laravel package to add healthchecks which can be integrated with govigilant.io

1.1.0(2mo ago)04731MITPHPPHP ^8.3CI passing

Since Nov 30Pushed 2mo agoCompare

[ Source](https://github.com/govigilant/laravel-healthchecks)[ Packagist](https://packagist.org/packages/govigilant/laravel-healthchecks)[ Docs](https://govigilant.io)[ RSS](/packages/govigilant-laravel-healthchecks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (15)Versions (5)Used By (1)

[ ![Banner](./art/banner.png)](https://github.com/govigilant/vigilant "Vigilant")Vigilant Laravel Healthchecks
=============================

[](#vigilant-laravel-healthchecks)

 [![Tests](https://camo.githubusercontent.com/2832fb3c53b2a18036d8f51d4dd82e2bc5b73ba93fc704b9cafea64bf697fdc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f766967696c616e742f6c61726176656c2d6865616c7468636865636b732f74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/govigilant/laravel-healthchecks) [![Analysis](https://camo.githubusercontent.com/78f52855f5ba5402508c889a0d49603fdd28c195e8fae88e1d9ec35375202585/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f766967696c616e742f6c61726176656c2d6865616c7468636865636b732f616e616c7973652e796d6c3f6c6162656c3d616e616c79736973267374796c653d666c61742d737175617265)](https://github.com/govigilant/laravel-healthchecks) [![Style](https://camo.githubusercontent.com/4b2425d0a84d5e5531bf8784772cc57570099de1ea29dec806ccb90c000a796c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f766967696c616e742f6c61726176656c2d6865616c7468636865636b732f7374796c652e796d6c3f6c6162656c3d7374796c65267374796c653d666c61742d737175617265)](https://github.com/govigilant/laravel-healthchecks) [![Total downloads](https://camo.githubusercontent.com/44a193b0c66a9a84559ef0e44596aaa4b011e557c4e34f6ed3409bf3b7c984a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f766967696c616e742f6c61726176656c2d6865616c7468636865636b733f636f6c6f723d626c7565267374796c653d666c61742d737175617265)](https://packagist.org/packages/govigilant/laravel-healthchecks)

A package that adds healthchecks to any Laravel application and integrates seamlessly with [Vigilant](https://github.com/govigilant/vigilant).

Features
--------

[](#features)

This package provides an API endpoint to check the health of your Laravel application. It returns two types of checks, health checks and metrics. Healthchecks are checks that indicate whether a specific part of your application is functioning correctly, while metrics provide numeric values that give insights on health over time. [Vigilant](https://github.com/govigilant/vigilant) can use these metrics to notify you of spikes or quickly increasing metrics.

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

[](#installation)

Install the package via Composer:

```
composer require govigilant/laravel-healthchecks
```

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

[](#configuration)

Set the API token in your `.env` file:

```
VIGILANT_HEALTHCHECK_TOKEN=your-vigilant-api-key-here
```

> **Note:** The token is required to access the health endpoint.

Optionally publish the configuration if you want to adjust default behavior:

```
php artisan vendor:publish --provider="Vigilant\LaravelHealthchecks\ServiceProvider"
```

This creates `config/vigilant-healthchecks.php`.

### Scheduler

[](#scheduler)

This package automatically schedules a command and a job to verify if your scheduler and queue workers are running. If you do not want or want to customize this behavior, you can disable the automatic scheduling in the config file by setting `schedule` to `false`.

Ensure to schedule the `php artisan vigilant:scheduler-heartbeat` yourself if you disable automatic scheduling.

Usage
-----

[](#usage)

### Accessing the Health Endpoint

[](#accessing-the-health-endpoint)

Once installed, the health check endpoint is available with your configured bearer token at:

```
POST /api/vigilant/health

```

Or using `curl`:

```
curl -X POST "YOUR_URL_HERE/api/vigilant/health" \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json"

```

### Registering Checks and Metrics

[](#registering-checks-and-metrics)

Register health checks and metrics in your `AppServiceProvider`'s `boot` method.

> **Note:** The package comes with defaults, so you may not need to register any checks or metrics manually when having the `register` setting enabled in the config file.

```
use Vigilant\LaravelHealthchecks\Facades\HealthCheck;
use Vigilant\LaravelHealthchecks\Checks\DatabaseCheck;
use Vigilant\LaravelHealthchecks\Checks\CacheCheck;
use Vigilant\LaravelHealthchecks\Checks\RedisCheck;
use Vigilant\LaravelHealthchecks\Checks\HorizonCheck;
use Vigilant\LaravelHealthchecks\Checks\SchedulerCheck;
use Vigilant\LaravelHealthchecks\Checks\Metrics\CpuLoadMetric;
use Vigilant\LaravelHealthchecks\Checks\Metrics\MemoryUsageMetric;
use Vigilant\LaravelHealthchecks\Checks\Metrics\DiskUsageMetric;

public function boot(): void
{
    HealthCheck::registerCheck(DatabaseCheck::make());
    HealthCheck::registerCheck(CacheCheck::make());
    HealthCheck::registerCheck(RedisCheck::make());
    HealthCheck::registerCheck(HorizonCheck::make());
    HealthCheck::registerCheck(SchedulerCheck::make());

    HealthCheck::registerMetric(CpuLoadMetric::make());
    HealthCheck::registerMetric(MemoryUsageMetric::make());
    HealthCheck::registerMetric(DiskUsageMetric::make());
}
```

### Configuring Specific Connections

[](#configuring-specific-connections)

If you want to check non-default connections you can register healthchecks yourself in your service provider.

```
use Vigilant\LaravelHealthchecks\Facades\HealthCheck;
use Vigilant\LaravelHealthchecks\Checks\DatabaseCheck;
use Vigilant\LaravelHealthchecks\Checks\CacheCheck;
use Vigilant\LaravelHealthchecks\Checks\RedisCheck;

public function boot(): void
{
    // Check a specific database connection
    HealthCheck::registerCheck(DatabaseCheck::make()->connection('mysql'));

    // Check a specific cache store
    HealthCheck::registerCheck(CacheCheck::make()->store('redis'));

    // Check a specific Redis connection
    HealthCheck::registerCheck(RedisCheck::make()->connection('sessions'));
}
```

### Check availability

[](#check-availability)

Each healthcheck checks if it is applicable in the current environment. For example, the `HorizonCheck` will only run if Laravel Horizon is installed. If a check is not applicable, it will be skipped and not included in the results. You may override this behaviour by registering the check manually can calling the `alwaysRun` method.

Available Checks
----------------

[](#available-checks)

CheckDescription**DatabaseCheck**Verifies database connection and query execution**CacheCheck**Tests cache read/write operations**RedisCheck**Verifies Redis connection health**RedisMemoryCheck**Monitors Redis max memory usage**QueueCheck**Checks queue workers are processing jobs**HorizonCheck**Verifies Laravel Horizon is running**SchedulerCheck**Ensures Laravel scheduler is active**StorageCheck**Validates storage directory permissions**DebugModeCheck**Warns if debug mode is enabled in productionAvailable Metrics
-----------------

[](#available-metrics)

MetricDescription**CpuLoadMetric**Current CPU load average**MemoryUsageMetric**System memory usage percentage**DiskUsageMetric**Disk space usage percentage**DatabaseSizeMetric**Total database size**LogFileSizeMetric**Laravel log file sizeDevelopment Environment
-----------------------

[](#development-environment)

A ready-to-use Docker-based development environment lives in `devenv/`. Ensure Docker is running, then start the stack: `docker compose -f devenv/docker-compose.yml up --build`.

This will create a Laravel application, link this package for development, and set the bearer token to `testing`, which can be used to access the health endpoint:

```
curl -X POST "http://localhost:8000/api/vigilant/health" \
  -H "Authorization: Bearer testing" \
  -H "Content-Type: application/json"
```

Quality
-------

[](#quality)

Run the quality checks:

```
composer quality
```

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Vincent Boon](https://github.com/VincentBean)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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

Every ~53 days

Total

3

Last Release

61d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f21e3a721fc25c880371c5d3af4925fe83e4b9d425bf50a2cbce18ee1af45931?d=identicon)[vincentbean](/maintainers/vincentbean)

---

Top Contributors

[![VincentBean](https://avatars.githubusercontent.com/u/3906942?v=4)](https://github.com/VincentBean "VincentBean (19 commits)")

---

Tags

healthcheckslaravellaravel-packagelaravelhealthchecksvigilant

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/govigilant-laravel-healthchecks/health.svg)

```
[![Health](https://phpackages.com/badges/govigilant-laravel-healthchecks/health.svg)](https://phpackages.com/packages/govigilant-laravel-healthchecks)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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