PHPackages                             srwiez/forge-heartbeats - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. srwiez/forge-heartbeats

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

srwiez/forge-heartbeats
=======================

Monitor Laravel scheduled tasks with Laravel Forge Heartbeats API

v1.2.1(1mo ago)4197MITPHPPHP ^8.2CI failing

Since Sep 5Pushed 1mo agoCompare

[ Source](https://github.com/SRWieZ/forge-heartbeats)[ Packagist](https://packagist.org/packages/srwiez/forge-heartbeats)[ Docs](https://github.com/srwiez/forge-heartbeats)[ RSS](/packages/srwiez-forge-heartbeats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (26)Versions (7)Used By (0)

Laravel Forge Heartbeats
========================

[](#laravel-forge-heartbeats)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e520b424bbe97ccb021873e83e962ecd24c4f37c1e66298d876445f6ddf7b3af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73727769657a2f666f7267652d686561727462656174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/srwiez/forge-heartbeats)[![GitHub Tests Action Status](https://camo.githubusercontent.com/78933bca62d045922b72a81d13ef4720a0f15c3fa951481810a313125019eeaa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73727769657a2f666f7267652d686561727462656174732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/srwiez/forge-heartbeats/actions?query=workflow%3Atests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/deffb14531472d36e3d5ea1367e744a5a2b1f1f88c4ea5fd924725a95ed89902/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73727769657a2f666f7267652d686561727462656174732f7374617469632d616e616c797369732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/srwiez/forge-heartbeats/actions?query=workflow%3A%22static-analysis%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/30b292527df521ff8e446a15f98822c1be7a4c3aa6f4401e84b61cbef94b881c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73727769657a2f666f7267652d686561727462656174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/srwiez/forge-heartbeats)

Monitor your Laravel scheduled commands with **Laravel Forge Heartbeats**.

This package automatically syncs your Laravel scheduled commands with Forge heartbeats and pings them when tasks run.

- **No Database Required** - Everything managed through Forge API
- **Automatic Sync** - Keep heartbeats in sync with your schedule
- **Automatic Pinging** - Tasks ping heartbeats when they run
- **Queue Support** - Non-blocking heartbeat pings via queues

> **Note**: this package is not ready yet. Forge v2 API is still in beta and behind a feature flag.

🚀 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require srwiez/forge-heartbeats
```

📚 Usage
-------

[](#-usage)

### 1. Get your credentials

[](#1-get-your-credentials)

1. **API Token**: Generate in your Forge dashboard (). You need at least `site:manage-heartbeats` and `server:view` permission for this package.
2. **Organization**: Look for the slug in the URL when viewing your organization (e.g., `my-org` in `https://forge.laravel.com/your-organization/`)
3. **Server ID**: Found in the server homepage
4. **Site ID**: Found in the site homepage

### 2. Set environment variables

[](#2-set-environment-variables)

Add these environment variables to your `.env` file:

```
FORGE_API_TOKEN=your_forge_api_token_here
FORGE_ORGANIZATION=your_organization_slug
FORGE_SERVER_ID=12345
FORGE_SITE_ID=67890

# Optional: Default grace period for heartbeats (default: 5 minutes)
FORGE_HEARTBEAT_GRACE_PERIOD=5

# Optional: Custom cache store for heartbeat data (default: uses Laravel's default cache)
FORGE_HEARTBEAT_CACHE_STORE=redis
```

For more configuration options, publish the config file:

```
php artisan vendor:publish --tag="forge-heartbeats-config"
```

### 3. Verify your configuration

[](#3-verify-your-configuration)

Test your Forge connection:

```
php artisan forge-heartbeats:verify
```

Then view the status of all your heartbeats:

```
php artisan forge-heartbeats:list
```

### 4. Sync Your Schedule

[](#4-sync-your-schedule)

This should run after every deployment to keep heartbeats up to date.

```
php artisan forge-heartbeats:sync
```

This command will:

- Create heartbeats for new scheduled tasks
- Update existing heartbeats if changed
- Remove heartbeats for deleted tasks (unless `--keep-old`)

### 5. Customize Your Tasks

[](#5-customize-your-tasks)

Add heartbeat configuration to your scheduled tasks:

```
// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // Basic task - uses command name as heartbeat name
    $schedule->command('backup:run')->daily();

    // Custom heartbeat name
    $schedule->command('reports:generate')
        ->hourly()
        ->heartbeatName('hourly-reports');

    // Custom grace period (time allowed for task to complete)
    $schedule->command('sync:users')
        ->daily()
        ->heartbeatName('user-sync')
        ->graceTimeInMinutes(30);

    // Skip monitoring for specific tasks
    $schedule->command('cache:clear')
        ->everyMinute()
        ->doNotMonitorOnForge();
}
```

👥 Credits
---------

[](#-credits)

- [SRWieZ](https://github.com/srwiez)
- [All Contributors](../../contributors)

📝 License
---------

[](#-license)

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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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 ~66 days

Total

4

Last Release

40d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/735894a4f6e39aa85e3d136abc9cf0be92da593d88731382384185293cbfe965?d=identicon)[SRWieZ](/maintainers/SRWieZ)

---

Top Contributors

[![SRWieZ](https://avatars.githubusercontent.com/u/1408020?v=4)](https://github.com/SRWieZ "SRWieZ (44 commits)")

---

Tags

laravelmonitoringcronforgescheduled-tasksheartbeats

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/srwiez-forge-heartbeats/health.svg)

```
[![Health](https://phpackages.com/badges/srwiez-forge-heartbeats/health.svg)](https://phpackages.com/packages/srwiez-forge-heartbeats)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2332.0M2](/packages/inspector-apm-inspector-laravel)[kssadi/log-tracker

A powerful, intuitive, and efficient log viewer for Laravel applications.

264.8k](/packages/kssadi-log-tracker)

PHPackages © 2026

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