celostad / apipartner-monitor
Queue Monitoring for ApiPartner Laravel Database Job Queue
Requires
- php: ^7.2|^8.0
- ext-json: *
- ext-mbstring: *
- illuminate/database: ^5.5|^6.0|^7.0|^8.0|^9.0
- illuminate/queue: ^5.5|^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^5.5|^6.0|^7.0|^8.0|^9.0
- nesbot/carbon: ^2.0
Requires (Dev)
- celostad/php-cs-fixer-config: ^3.0
- friendsofphp/php-cs-fixer: ^3.0
- laravel/framework: ^5.5|^6.0|^7.0|^8.0|^9.0
- mockery/mockery: ^1.3.2
- orchestra/testbench: ^3.8|^4.0|^5.0|^6.0
- phpstan/phpstan: ^0.12.99|^1.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2024-05-06 20:25:26 UTC
README
composer require celostad/apipartner-monitor
Configuration
Copy configuration & migration to your project:
php artisan vendor:publish --provider="celostad\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
To monitor a job, simply add the celostad\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 celostad\QueueMonitor\Traits\IsMonitored; // <--- class ExampleJob implements ShouldQueue { use Dispatchable; use InteractsWithQueue; use Queueable; use SerializesModels; use IsMonitored; // <--- }
Important! You need to implement the Illuminate\Contracts\Queue\ShouldQueue
interface to your job class. Otherwise, Laravel will not dispatch any events containing status information for monitoring the job.
UI
You can enable the optional UI routes by calling Route::queueMonitor()
inside your route file, similar to the official
Route::prefix('jobs')->group(function () { Route::queueMonitor(); });
This package was inspired by gilbitron's laravel-queue-monitor which is not maintained anymore.