PHPackages                             violetshih/laravel-mongo-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. violetshih/laravel-mongo-queue-monitor

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

violetshih/laravel-mongo-queue-monitor
======================================

Queue Monitoring for Laravel MongoDb Job Queue

1.0.0(2y ago)1301[1 PRs](https://github.com/violetshih/laravel-mongo-queue-monitor/pulls)MITPHPPHP ^7.2|^8.0|^8.1

Since Oct 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/violetshih/laravel-mongo-queue-monitor)[ Packagist](https://packagist.org/packages/violetshih/laravel-mongo-queue-monitor)[ RSS](/packages/violetshih-laravel-mongo-queue-monitor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (3)Used By (0)

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

[](#laravel-mongo-queue-monitor)

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

This package is a fork of romanzipp's [laravel-queue-monitor](https://github.com/romanzipp/Laravel-Queue-Monitor)

This package require Jenssegers [laravel-mongodb](https://github.com/jenssegers/laravel-mongodb)

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

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

[](#installation)

```
composer require violetshih/laravel-mongo-queue-monitor

```

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

[](#configuration)

Copy configuration &amp; migration to your project:

```
php artisan vendor:publish --provider="violetshih\MongoQueueMonitor\Providers\MongoQueueMonitorProvider"

```

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 `violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\Traits\IsMonitored; // group(function () {
    Route::queueMonitor();
});
```

### Routes

[](#routes)

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

[![Preview](https://raw.githubusercontent.com/violetshih/laravel-mongo-queue-monitor/master/preview.png)](https://raw.githubusercontent.com/violetshih/laravel-mongo-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 violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\Traits\IsMonitored;

class FrequentSucceedingJob implements ShouldQueue
{
    use IsMonitored;

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

### Retrieve processed Jobs

[](#retrieve-processed-jobs)

```
use violetshih\MongoQueueMonitor\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 violetshih\MongoQueueMonitor\Models\Monitor;

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

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

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

---

This package is a fork of romanzipp's [laravel-queue-monitor](https://github.com/romanzipp/Laravel-Queue-Monitor)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

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

Unknown

Total

1

Last Release

932d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/440dbf29cc28708852097b34799c865e4a998d8d5df8fbafea1e7e920ffbdcbc?d=identicon)[violetshih](/maintainers/violetshih)

---

Top Contributors

[![violetshih](https://avatars.githubusercontent.com/u/16809281?v=4)](https://github.com/violetshih "violetshih (9 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/violetshih-laravel-mongo-queue-monitor/health.svg)](https://phpackages.com/packages/violetshih-laravel-mongo-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)[romanzipp/laravel-queue-monitor

Queue Monitoring for Laravel Database Job Queue

8271.6M1](/packages/romanzipp-laravel-queue-monitor)[imtigger/laravel-job-status

Laravel Job Status

5272.1M3](/packages/imtigger-laravel-job-status)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[palpalani/laravel-sqs-queue-json-reader

Custom SQS queue reader for Laravel

26109.8k](/packages/palpalani-laravel-sqs-queue-json-reader)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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