jaydeep/laravel-queue-monitor
Composer 安装命令:
composer require jaydeep/laravel-queue-monitor
包简介
Monitor your Laravel queues — track pending, running, completed, and failed jobs from an Artisan command or a live web dashboard.
README 文档
README
Monitor your Laravel queues at a glance. Laravel Queue Monitor records the full lifecycle of every queued job and shows you pending, running, completed, and failed jobs — from an Artisan command or a live web dashboard.
Laravel ships with failed_jobs (failed) and a jobs table (pending, database
driver only), but it never stores completed jobs. This package fills that gap
by subscribing to Laravel's queue events and persisting each job's lifecycle to
a dedicated queue_monitor table — so it works with any queue driver
(database, Redis, SQS, …).
Requirements
- PHP 7.4 – 8.4
- Laravel 8 – 12
Installation
composer require jaydeep/laravel-queue-monitor
The service provider is auto-discovered. Publish and run the migration:
php artisan vendor:publish --tag=queue-monitor-migrations php artisan migrate
Optionally publish the config and views:
php artisan vendor:publish --tag=queue-monitor-config php artisan vendor:publish --tag=queue-monitor-views
Usage
Artisan command
php artisan queue-monitor:show
Queue Monitor
+---------+---------+-----------+--------+-------+
| Pending | Running | Completed | Failed | Total |
+---------+---------+-----------+--------+-------+
| 3 | 1 | 128 | 2 | 134 |
+---------+---------+-----------+--------+-------+
Options:
| Option | Description |
|---|---|
--json |
Output the full snapshot as JSON |
--limit=N |
Number of recent jobs to list |
--prune |
Delete records older than the configured retention hours |
Web dashboard
Visit /queue-monitor in your browser for a live, auto-refreshing
dashboard. It polls /queue-monitor/stats (JSON) on the interval set in config.
Security: the dashboard uses the
webmiddleware group by default. Before exposing it in production, add authentication/authorization middleware inconfig/queue-monitor.php(route.middleware).
Configuration
config/queue-monitor.php:
| Key | Default | Description |
|---|---|---|
enabled |
true |
Master switch for lifecycle recording |
table |
queue_monitor |
Monitor table name |
connection |
null |
DB connection for the table (null = default) |
route.enabled |
true |
Enable the web dashboard routes |
route.prefix |
queue-monitor |
URL prefix for the dashboard |
route.middleware |
['web'] |
Middleware applied to the dashboard routes |
route.refresh |
5 |
Dashboard auto-refresh interval (seconds) |
recent_limit |
25 |
Recent jobs shown in command and dashboard |
prune_after_hours |
72 |
Retention window used by --prune (null = keep) |
How it works
The package registers a subscriber for Laravel's queue events:
| Event | Recorded status |
|---|---|
JobQueued |
queued |
JobProcessing |
running |
JobProcessed |
completed |
JobFailed |
failed |
All monitor writes are wrapped in a guard, so a monitoring error can never interrupt the job being processed.
Testing
composer install ./vendor/bin/phpunit
License
MIT © Jaydeep Gadhiya
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-10