PHPackages                             bramr/stack-heartbeat - 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. bramr/stack-heartbeat

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

bramr/stack-heartbeat
=====================

Stack middleware which provides a heartbeat url for your application

v1.0.0(10y ago)124MITPHP &gt;=5.4.0

Since Jun 4Compare

[ Source](https://github.com/bramr/stack-heartbeat)[ Packagist](https://packagist.org/packages/bramr/stack-heartbeat)[ RSS](/packages/bramr-stack-heartbeat/feed)WikiDiscussions Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Stack\\Heartbeat
================

[](#stackheartbeat)

A simple [Stack](http://stackphp.com) middleware which adds a route to your application to respond to heartbeat requests.

[![Build Status](https://camo.githubusercontent.com/fd32505fe77e40551c8f41d02e976bd28506541efd9f7ecd94ece34ff34cf425/68747470733a2f2f7472617669732d63692e6f72672f6272616d722f737461636b2d6865617274626561742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bramr/stack-heartbeat) [![Code Coverage](https://camo.githubusercontent.com/234d5bef3c9073ba26203cf4d5fcc4ea1c1c98d1caf5ea4df8005defd83292dd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6272616d722f737461636b2d6865617274626561742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bramr/stack-heartbeat/?branch=master)

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

[](#installation)

The easiest way to install stack-heartbeat is through [Composer](https://getcomposer.org).

```
composer require bramr/stack-heartbeat

```

Usage
-----

[](#usage)

By default the middleware responds to the route: **/heartbeat.check** with a plain text message "OK"

```
public function __construct(HttpKernelInterface $app, $route = '/heartbeat.check', callable $handler = null)
```

The optional constructor arguments allows you to change the route or add a custom handler when the route is called. This allows you to alter the response but also to add checks to your application which check dependencies like a database, files, etc.

An example:

```
$app = new  CallableHttpKernel(function (Request $request) {
    return new Response('#yolo');
});

$app = (new Stack\Builder)
    ->push(BramR\Stack\Heartbeat::class)
    ->push(BramR\Stack\Heartbeat::class, '/custom', function () use ($diContainer) {
        return new Response(
            'Implement custom heartbeat check, to check some stuff in db:' . $diContainer['db.name']
        );
    })
    ->resolve($app);

Stack\run($app);
```

See example.php for a complete (and more complicated) example.

License
-------

[](#license)

MIT, for details see LICENSE file.

---

*Inspired by [Rack::Heartbeat](https://github.com/imajes/rack-heartbeat).*

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

3678d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1217758?v=4)[bramr](/maintainers/bramr)[@bramr](https://github.com/bramr)

---

Top Contributors

[![bramr](https://avatars.githubusercontent.com/u/1217758?v=4)](https://github.com/bramr "bramr (6 commits)")

### Embed Badge

![Health badge](/badges/bramr-stack-heartbeat/health.svg)

```
[![Health](https://phpackages.com/badges/bramr-stack-heartbeat/health.svg)](https://phpackages.com/packages/bramr-stack-heartbeat)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k246.0M11.1k](/packages/symfony-framework-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k181.3M2.2k](/packages/symfony-security-bundle)[symfony/security-http

Symfony Security Component - HTTP Integration

1.7k172.8M350](/packages/symfony-security-http)[symfony/ux-autocomplete

JavaScript Autocomplete functionality for Symfony

635.5M36](/packages/symfony-ux-autocomplete)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)

PHPackages © 2026

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