PHPackages                             documateai/watchtower - 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. documateai/watchtower

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

documateai/watchtower
=====================

Cross-platform Laravel queue monitoring and worker management

v3.3.1(2mo ago)02051MITPHPPHP ^8.2

Since Feb 5Pushed 2mo agoCompare

[ Source](https://github.com/documateai/watchtower)[ Packagist](https://packagist.org/packages/documateai/watchtower)[ GitHub Sponsors](https://github.com/nathanphelps)[ RSS](/packages/documateai-watchtower/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (26)Used By (0)

Watchtower
==========

[](#watchtower)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6e6049ed2ff9bfbec3e807bc382ea5470340fb6772d5fdec878836eac8b84afc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f63756d61746561692f7761746368746f7765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/documateai/watchtower)[![PHP Version](https://camo.githubusercontent.com/4de6c08dd1e0c6a0d6eb8751fba7a6dea34a5791b4defac89f857f309023d464/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f63756d61746561692f7761746368746f7765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/documateai/watchtower)[![License](https://camo.githubusercontent.com/3935234da7f43ee58d3a842fc197c9ec07ed2e67ac5537dbed6ae7e33f382793/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f63756d61746561692f7761746368746f7765722e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

> Cross-platform Laravel queue monitoring and worker management dashboard

Watchtower provides queue monitoring and worker management capabilities similar to Laravel Horizon, but with full cross-platform support including Windows. Unlike Horizon, which relies on PCNTL signals (Unix-only), Watchtower uses a polling-based approach for worker control that works on Windows, Linux, and macOS.

Features
--------

[](#features)

- 📊 **Queue Monitoring Dashboard** - Real-time job tracking, status monitoring, and metrics
- ⚙️ **Worker Management** - Start, stop, pause, resume workers from the web UI
- 🖥️ **Cross-Platform** - Works on Windows, Linux, and macOS
- 📋 **Job Tracking** - Job status, payload, exceptions, retries, worker info
- 🎨 **Modern UI** - Alpine.js dark-themed dashboard (no build step required)
- 🗑️ **Automatic Cleanup** - Time-based pruning of old job records

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- Redis (optional -- required only when using the default `redis` command bus driver)

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

[](#installation)

```
composer require documateai/watchtower
```

Publish the configuration and assets:

```
php artisan vendor:publish --tag=watchtower-config
php artisan vendor:publish --tag=watchtower-migrations
php artisan migrate
```

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

[](#configuration)

The package configuration is published to `config/watchtower.php`:

```
return [
    // Dashboard URL path
    'path' => env('WATCHTOWER_PATH', 'watchtower'),

    // Route middleware
    'middleware' => ['web'],

    // Authorization gate
    'gate' => env('WATCHTOWER_GATE', 'viewWatchtower'),

    // Command bus driver: 'redis' or 'database'
    'command_bus' => env('WATCHTOWER_COMMAND_BUS', 'redis'),

    // Job retention (days)
    'retention' => [
        'completed' => 7,
        'failed' => 30,
    ],

    // Supervisor configuration
    'supervisors' => [
        'default' => [
            'connection' => 'redis',
            'queue' => '*',           // Auto-discover all queues!
            // Or specify explicit queues:
            // 'queue' => ['default', 'emails', 'notifications'],
            'min_processes' => 1,
            'max_processes' => 10,
            'tries' => 3,
            'timeout' => 60,
        ],
    ],
];
```

Usage
-----

[](#usage)

### Starting the Supervisor

[](#starting-the-supervisor)

Run the supervisor to automatically manage your queue workers:

```
php artisan watchtower:supervisor
```

The supervisor will:

- **Auto-discover all queues** in your application (Redis keys, job records)
- Maintain the minimum number of workers
- Restart failed workers automatically
- Monitor worker health via heartbeats

> **Tip:** Set `'queue' => '*'` in your config (default) to automatically detect and process all queues. Or specify explicit queues: `'queue' => ['default', 'emails', 'high']`

### Manual Worker Control

[](#manual-worker-control)

Start a single worker manually:

```
php artisan watchtower:worker default
```

### Zero-Downtime Deployments

[](#zero-downtime-deployments)

Gracefully restart all workers after deploying new code:

```
php artisan watchtower:restart
```

Options:

- `--queue=emails` - Only restart workers on a specific queue
- `--force` - Force immediate restart (don't wait for current job)

Workers will finish processing their current job, then restart with fresh code.

### Terminating All Processes

[](#terminating-all-processes)

Stop the supervisor and all workers (similar to `horizon:terminate`):

```
php artisan watchtower:terminate
```

Options:

- `--wait` - Wait for all workers to finish before returning

### Accessing the Dashboard

[](#accessing-the-dashboard)

Visit `/watchtower` in your browser. By default, the dashboard is only accessible in local environments. Configure the gate in your `AuthServiceProvider` for production:

```
Gate::define('viewWatchtower', function ($user) {
    return in_array($user->email, [
        'admin@example.com',
    ]);
});
```

### Pruning Old Jobs

[](#pruning-old-jobs)

Watchtower automatically prunes old job records. You can also run the prune command manually:

```
php artisan watchtower:prune
```

How It Works
------------

[](#how-it-works)

### Polling-Based Control via CommandBus

[](#polling-based-control-via-commandbus)

Unlike Horizon which uses PCNTL signals (Unix-only), Watchtower uses a `CommandBusInterface` for worker control with two drivers:

- **Redis** (default) -- fast, uses `Redis::connection()`
- **Database** -- no Redis required, uses `watchtower_commands` table

```
WATCHTOWER_COMMAND_BUS=database  # set in .env to use database driver

```

1. Dashboard sends command via CommandBus: `$commandBus->put("watchtower:worker:{id}:command", "stop")`
2. Worker polls the CommandBus every 3 seconds
3. Worker reads and executes the command
4. Worker confirms status in database

This approach provides:

- ✅ Cross-platform compatibility
- ✅ No PCNTL dependency
- ✅ Redis optional (database driver available)
- ✅ Simple debugging
- ⚠️ 1-3 second response delay (acceptable for worker management)

### Dashboard Updates

[](#dashboard-updates)

The dashboard polls for updates every 3 seconds (configurable). This provides near-real-time visibility into:

- Job counts and status
- Worker health and activity
- Throughput metrics

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`watchtower:supervisor`Start the supervisor to manage workers`watchtower:worker {queue}`Start a single worker process`watchtower:restart`Gracefully restart all workers`watchtower:terminate`Stop supervisor and all workers`watchtower:status`Show current supervisor and worker status`watchtower:prune`Prune old job recordsLicense
-------

[](#license)

MIT License. See [LICENSE.md](LICENSE.md) for details.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover a security vulnerability, please send an email instead of using the issue tracker. See [SECURITY.md](SECURITY.md) for details.

Credits
-------

[](#credits)

- [Nathan Phelps](https://github.com/nathanphelps)
- [Claude Code](https://claude.ai) - AI pair programming assistant
- [All Contributors](../../contributors)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance83

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

25

Last Release

85d ago

Major Versions

v1.1.4 → v2.0.02026-02-10

v2.0.0 → v3.0.02026-02-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/96e5b7a55fed4741fd072e7384ac51dda7020815889ab8c47ebc78c955b1e023?d=identicon)[nathanphelps](/maintainers/nathanphelps)

---

Top Contributors

[![nathanphelps](https://avatars.githubusercontent.com/u/26461946?v=4)](https://github.com/nathanphelps "nathanphelps (36 commits)")

---

Tags

laravelmonitoringlaravel 12queuewindowscross-platformhorizonworkers

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/documateai-watchtower/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[spatie/laravel-health

Monitor the health of a Laravel application

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

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[yangusik/laravel-balanced-queue

Laravel queue management with load balancing between partitions (user groups)

786.4k](/packages/yangusik-laravel-balanced-queue)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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