This is a Laravel Priority Queue Driver that uses the database driver to implement a simple priority queue for Laravel applications. It supports Laravel 9 and 10, as well as PHP 8.1+. The architecture is based on Seth Phat's Laravel Priority Queue, which uses ORDER BY and INDEX for faster message processing, and provides visibility and flexibility by storing jobs and their data in the database.
To install the library, you need to run `composer require shipsaas/laravel-priority-queue` and then publish and run the migration using `php artisan vendor:publish --tag=priority-queue-migrations && php artisan migrate`. You also need to add a new connection to the `config/queue.php` file.
You can define a hardcoded job weight or calculate it dynamically using the UseJobPrioritization trait. To dispatch the queue messages, you can use the normal Dispatcher or Queue Facade. To run the queue worker, you need to use `php artisan queue:work database-priority`.
The available tests include unit testing and integration testing against MySQL and the queue:work command. Contributions are welcome, as long as they follow PSR-1/PSR-12 coding conventions and include unit tests. This package is licensed under the MIT License.