PHPackages                             trwl/laravel-queue-monitor - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. trwl/laravel-queue-monitor

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

trwl/laravel-queue-monitor
==========================

Queue Monitoring for Laravel Database Job Queue

v2.1.1(3y ago)018MITPHPPHP ^7.2|^8.0

Since Sep 19Pushed 3y agoCompare

[ Source](https://github.com/Traewelling/Laravel-Queue-Monitor)[ Packagist](https://packagist.org/packages/trwl/laravel-queue-monitor)[ GitHub Sponsors](https://github.com/romanzipp)[ RSS](/packages/trwl-laravel-queue-monitor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (3)Used By (0)

Laravel Queue Monitor
=====================

[](#laravel-queue-monitor)

[![Latest Stable Version](https://camo.githubusercontent.com/178424860d66d4633bfaea503ff890e16e45c8c3b06ec59015aab2094083624f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472616577656c6c696e672f6c61726176656c2d71756575652d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/traewelling/laravel-queue-monitor)[![Total Downloads](https://camo.githubusercontent.com/56f5f7b2d395299ac883312c8ddf7b561c35ec17ec2e2e743a72e0a63dbced56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7472616577656c6c696e672f6c61726176656c2d71756575652d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/traewelling/laravel-queue-monitor)[![GitHub Build Status](https://camo.githubusercontent.com/4535b3dd31053f9092bff158d4c7e029b0c63a2510c6eca2ab650047f1352ecd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7472616577656c6c696e672f4c61726176656c2d51756575652d4d6f6e69746f722f54657374733f7374796c653d666c61742d737175617265)](https://github.com/traewelling/Laravel-Queue-Monitor/actions)

This package offers monitoring like [Laravel Horizon](https://laravel.com/docs/horizon) for database queue.

Features
--------

[](#features)

- Monitor jobs like [Laravel Horizon](https://laravel.com/docs/horizon) for any queue
- Handle failing jobs with storing exception
- Monitor job progress
- Get an estimated time remaining for a job
- Store additional data for a job monitoring
- In this fork:
    - Show `time_elapsed` with sub-second precision
    - Remove old and unused monitoring data (see `delete_old_items_after_days`)

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

[](#installation)

```
composer require traewelling/laravel-queue-monitor

```

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

[](#configuration)

Copy configuration &amp; migration to your project:

```
php artisan vendor:publish --provider="Traewelling\QueueMonitor\Providers\QueueMonitorProvider"  --tag=config --tag=migrations

```

Migrate the Queue Monitoring table. The table name can be configured in the config file or via the published migration.

```
php artisan migrate

```

Usage
-----

[](#usage)

To monitor a job, simply add the `Traewelling\QueueMonitor\Traits\IsMonitored` Trait.

```
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Traewelling\QueueMonitor\Traits\IsMonitored; // group(function () {
    Route::queueMonitor();
});
```

### Routes

[](#routes)

RouteAction`/`Show the jobs tableSee the [full configuration file](https://github.com/traewelling/Laravel-Queue-Monitor/blob/master/config/queue-monitor.php) for more information.

[![Preview](https://raw.githubusercontent.com/traewelling/Laravel-Queue-Monitor/master/preview.png)](https://raw.githubusercontent.com/traewelling/Laravel-Queue-Monitor/master/preview.png)

Extended usage
--------------

[](#extended-usage)

### Progress

[](#progress)

You can set a **progress value** (0-100) to get an estimation of a job progression.

```
use Illuminate\Contracts\Queue\ShouldQueue;
use traewelling\QueueMonitor\Traits\IsMonitored;

class ExampleJob implements ShouldQueue
{
    use IsMonitored;

    public function handle()
    {
        $this->queueProgress(0);

        // Do something...

        $this->queueProgress(50);

        // Do something...

        $this->queueProgress(100);
    }
}
```

### Chunk progress

[](#chunk-progress)

A common scenario for a job is iterating through large collections.

This example job loops through a large amount of users and updates it's progress value with each chunk iteration.

```
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Collection;
use Traewelling\QueueMonitor\Traits\IsMonitored;

class ChunkJob implements ShouldQueue
{
    use IsMonitored;

    public function handle()
    {
        $usersCount = User::count();

        $perChunk = 50;

        User::query()
            ->chunk($perChunk, function (Collection $users) use ($perChunk, $usersCount) {

                $this->queueProgressChunk($usersCount‚ $perChunk);

                foreach ($users as $user) {
                    // ...
                }
            });
    }
}
```

### Progress cooldown

[](#progress-cooldown)

To avoid flooding the database with rapidly repeating update queries, you can set override the `progressCooldown` method and specify a length in seconds to wait before each progress update is written to the database. Notice that cooldown will always be ignore for the values 0, 25, 50, 75 and 100.

```
use Illuminate\Contracts\Queue\ShouldQueue;
use Traewelling\QueueMonitor\Traits\IsMonitored;

class LazyJob implements ShouldQueue
{
    use IsMonitored;

    public function progressCooldown(): int
    {
        return 10; // Wait 10 seconds between each progress update
    }
}
```

### Custom data

[](#custom-data)

This package also allows setting custom data in array syntax on the monitoring model.

```
use Illuminate\Contracts\Queue\ShouldQueue;
use Traewelling\QueueMonitor\Traits\IsMonitored;

class CustomDataJob implements ShouldQueue
{
    use IsMonitored;

    public function handle()
    {
        $this->queueData(['foo' => 'Bar']);

        // WARNING! This is overriding the monitoring data
        $this->queueData(['bar' => 'Foo']);

        // To preserve previous data and merge the given payload, set the $merge parameter true
        $this->queueData(['bar' => 'Foo'], true);
    }
}
```

In order to show custom data on UI you need to add this line under `config/queue-monitor.php`

```
'ui' => [
    ...

    'show_custom_data' => true,

    ...
]
```

### Only keep failed jobs

[](#only-keep-failed-jobs)

You can override the `keepMonitorOnSuccess()` method to only store failed monitor entries of an executed job. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. Alternatively you can use Laravel's built in `failed_jobs` table.

```
use Illuminate\Contracts\Queue\ShouldQueue;
use Traewelling\QueueMonitor\Traits\IsMonitored;

class FrequentSucceedingJob implements ShouldQueue
{
    use IsMonitored;

    public static function keepMonitorOnSuccess(): bool
    {
        return false;
    }
}
```

### Retrieve processed Jobs

[](#retrieve-processed-jobs)

```
use Traewelling\QueueMonitor\Models\Monitor;

$job = Monitor::query()->first();

// Check the current state of a job
$job->isFinished();
$job->hasFailed();
$job->hasSucceeded();

// Exact start & finish dates with milliseconds
$job->getStartedAtExact();
$job->getFinishedAtExact();

// If the job is still running, get the estimated seconds remaining
// Notice: This requires a progress to be set
$job->getRemainingSeconds();
$job->getRemainingInterval(); // Carbon\CarbonInterval

// Retrieve any data that has been set while execution
$job->getData();

// Get the base name of the executed job
$job->getBasename();
```

### Model Scopes

[](#model-scopes)

```
use Traewelling\QueueMonitor\Models\Monitor;

// Filter by Status
Monitor::failed();
Monitor::succeeded();

// Filter by Date
Monitor::lastHour();
Monitor::today();

// Chain Scopes
Monitor::today()->failed();
```

---

This package was inspired by gilbitron's [laravel-queue-monitor](https://github.com/gilbitron/laravel-queue-monitor) which is not maintained anymore and romanzipp's [Laravel-Queue-Monitor](https://github.com/romanzipp/Laravel-Queue-Monitor) with a few custom additions.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.9% 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 ~0 days

Total

2

Last Release

1331d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac58b3aec3dadbf487c45d852e5df107a3d350812f47dc7e658f8abefd68c4a1?d=identicon)[HerrLevin\_](/maintainers/HerrLevin_)

![](https://www.gravatar.com/avatar/0cd3713e45f9291c1a28a80e1e60eeb86cbf6901c148b3ada2d4bd8fcfc51720?d=identicon)[jeyemwey](/maintainers/jeyemwey)

---

Top Contributors

[![romanzipp](https://avatars.githubusercontent.com/u/11266773?v=4)](https://github.com/romanzipp "romanzipp (216 commits)")[![jeyemwey](https://avatars.githubusercontent.com/u/2796271?v=4)](https://github.com/jeyemwey "jeyemwey (5 commits)")[![davidhernandeze](https://avatars.githubusercontent.com/u/22482495?v=4)](https://github.com/davidhernandeze "davidhernandeze (4 commits)")[![darron1217](https://avatars.githubusercontent.com/u/8064923?v=4)](https://github.com/darron1217 "darron1217 (3 commits)")[![raavus-funkmaster](https://avatars.githubusercontent.com/u/42815989?v=4)](https://github.com/raavus-funkmaster "raavus-funkmaster (3 commits)")[![emildayan](https://avatars.githubusercontent.com/u/22715782?v=4)](https://github.com/emildayan "emildayan (1 commits)")[![owenconti](https://avatars.githubusercontent.com/u/791222?v=4)](https://github.com/owenconti "owenconti (1 commits)")[![eboye](https://avatars.githubusercontent.com/u/624357?v=4)](https://github.com/eboye "eboye (1 commits)")[![huzaifaarain](https://avatars.githubusercontent.com/u/8613679?v=4)](https://github.com/huzaifaarain "huzaifaarain (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/trwl-laravel-queue-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/trwl-laravel-queue-monitor/health.svg)](https://phpackages.com/packages/trwl-laravel-queue-monitor)
```

###  Alternatives

[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[illuminate/queue

The Illuminate Queue package.

20331.4M1.2k](/packages/illuminate-queue)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[alajusticia/laravel-expirable

Make Eloquent models expirable

2193.4k5](/packages/alajusticia-laravel-expirable)

PHPackages © 2026

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