PHPackages                             balkar/laravel-priority-queue-manager - 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. balkar/laravel-priority-queue-manager

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

balkar/laravel-priority-queue-manager
=====================================

Dispatch and manage Laravel jobs with priority levels — critical, high, normal, low.

00PHPCI passing

Since Jun 10Pushed todayCompare

[ Source](https://github.com/balkar1998/laravel-priority-queue-manager)[ Packagist](https://packagist.org/packages/balkar/laravel-priority-queue-manager)[ RSS](/packages/balkar-laravel-priority-queue-manager/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Laravel Priority Queue Manager
==============================

[](#laravel-priority-queue-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9c8ba4aaf705ce9474625320075cdffa3b2bb51f27cc5cd624bd5a5147b2fa72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616c6b61722f6c61726176656c2d7072696f726974792d71756575652d6d616e616765722e737667)](https://packagist.org/packages/balkar/laravel-priority-queue-manager)[![Total Downloads](https://camo.githubusercontent.com/9928cf880412d04e05369c5bb87aa772bc48dd96466b0d0423794d3d9ca0ee77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616c6b61722f6c61726176656c2d7072696f726974792d71756575652d6d616e616765722e737667)](https://packagist.org/packages/balkar/laravel-priority-queue-manager)[![Tests](https://github.com/YOUR_GITHUB_USERNAME/laravel-priority-queue-manager/actions/workflows/tests.yml/badge.svg)](https://github.com/YOUR_GITHUB_USERNAME/laravel-priority-queue-manager/actions)[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/c9f64f714c636ba27a3bba6dfd52f98426832db1262747efa54b212d16943651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c7565)](https://www.php.net/)[![Laravel](https://camo.githubusercontent.com/f9f1aee5261b3b9aa8b1f3094ea1fe03a38308a41ba790f53ec2a6a767a81137/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31302532302537432532303131253230253743253230313225323025374325323031332d726564)](https://laravel.com)

A Laravel package to dispatch and manage jobs across priority queues — **critical**, **high**, **normal**, and **low** — with a clean Facade API and a built-in artisan command to monitor queue health.

---

The Problem
-----------

[](#the-problem)

Laravel's default queue is first-in, first-out. If 500 newsletter jobs are queued ahead of an OTP job, your user waits 30 seconds on the login screen. There's no built-in concept of "this job is more important than that one."

The Solution
------------

[](#the-solution)

This package gives you a clean priority layer on top of Laravel's existing queue system — no new infrastructure, no Redis required, works with any queue driver.

```
Priority::critical(new SendOTPJob($user));     // runs first
Priority::high(new SendInvoiceJob($order));
Priority::normal(new SendWelcomeEmail($user));
Priority::low(new SendNewsletterJob($batch));  // runs last
```

---

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

[](#requirements)

LaravelPHPTestbench10.x8.2+^8.011.x8.2+^9.012.x8.2+^10.013.x8.3+^10.0---

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

[](#installation)

```
composer require balkar/laravel-priority-queue-manager
```

Publish the config file:

```
php artisan vendor:publish --tag=priority-queue-config
```

---

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

[](#configuration)

After publishing, `config/priority-queue.php` will contain:

```
return [
    'priorities' => [
        'critical' => ['workers' => 3, 'retry_after' => 30,  'tries' => 5],
        'high'     => ['workers' => 2, 'retry_after' => 60,  'tries' => 4],
        'normal'   => ['workers' => 1, 'retry_after' => 90,  'tries' => 3],
        'low'      => ['workers' => 1, 'retry_after' => 300, 'tries' => 2],
    ],
];
```

Adjust workers, retry timing, and max tries per priority level to match your app's needs.

---

Usage
-----

[](#usage)

### Dispatching jobs

[](#dispatching-jobs)

Import the facade and dispatch any `ShouldQueue` job with a priority:

```
use Balkar\PriorityQueue\Facades\Priority;

Priority::critical(new SendOTPJob($user));
Priority::high(new SendInvoiceJob($order));
Priority::normal(new SendWelcomeEmail($user));
Priority::low(new SendNewsletterJob($batch));
```

### Running workers in priority order

[](#running-workers-in-priority-order)

```
php artisan queue:work --queue=critical,high,normal,low
```

Laravel will always drain the `critical` queue first before moving to `high`, and so on.

### Running dedicated workers per priority

[](#running-dedicated-workers-per-priority)

For high-traffic apps, run separate workers per queue:

```
# Terminal 1 — 3 workers for critical
php artisan queue:work --queue=critical &
php artisan queue:work --queue=critical &
php artisan queue:work --queue=critical &

# Terminal 2 — 1 worker for low priority
php artisan queue:work --queue=low
```

---

Artisan Command
---------------

[](#artisan-command)

Monitor your queue health at any time:

```
php artisan queue:priority-status
```

Output:

Laravel Priority Queue Status +----------+-------------+---------+-----------+-------------+--------+ | Priority | Queued Jobs | Workers | Max Tries | Retry After | Status | +----------+-------------+---------+-----------+-------------+--------+ | CRITICAL | 1 | 3 | 5 | 30s | ACTIVE | | HIGH | 5 | 2 | 4 | 60s | ACTIVE | | NORMAL | 23 | 1 | 3 | 90s | ACTIVE | | LOW | 150 | 1 | 2 | 300s | BUSY | +----------+-------------+---------+-----------+-------------+--------+

Status levels:

- `IDLE` — no jobs in queue
- `ACTIVE` — 1–10 jobs queued
- `BUSY` — 10+ jobs queued

---

Real World Example
------------------

[](#real-world-example)

This package was born from a real production problem — a student grade calculation engine that processed recursive async jobs across thousands of students. Critical recalculations (triggered by exam updates) were getting stuck behind bulk report generation jobs.

```
// Exam result updated — must recalculate immediately
Priority::critical(new RecalculateStudentGrade($student, $exam));

// Bulk PDF report generation — can wait
Priority::low(new GenerateBulkReportJob($cohort));
```

---

Testing
-------

[](#testing)

```
composer test
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for recent changes.

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first.

License
-------

[](#license)

MIT. Please see [LICENSE](LICENSE) for more information.

Author
------

[](#author)

**Balkar Singh** —

[balkar.co.in](https://balkar.co.in) · [GitHub](https://github.com/balkar1998) · [LinkedIn](https://linkedin.com/in/balkar-singh-6828a7234)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66656246?v=4)[Balkar singh](/maintainers/balkar1998)[@balkar1998](https://github.com/balkar1998)

---

Top Contributors

[![balkar1998](https://avatars.githubusercontent.com/u/66656246?v=4)](https://github.com/balkar1998 "balkar1998 (13 commits)")

### Embed Badge

![Health badge](/badges/balkar-laravel-priority-queue-manager/health.svg)

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M29](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M492](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[ezsystems/ezscriptmonitor-ls

eZ Publish extension that aims to avoid timeout problems and database corruption by moving long running processes from the GUI to the background.

13208.2k](/packages/ezsystems-ezscriptmonitor-ls)

PHPackages © 2026

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