PHP code example of mbm-rafal / laravel-single-dispatch

1. Go to this page and download the library: Download mbm-rafal/laravel-single-dispatch library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mbm-rafal / laravel-single-dispatch example snippets


// Illuminate\Bus\BusServiceProvider::class,
\MBM\Bus\BusServiceProvider::class,

# Manage processed jobs
Queue::after(function (JobProcessed $event) {
    app(\MBM\Bus\Dispatcher::class)->unregister($event->job);
});

Queue::failing(function (JobFailed $event) {
    app(\MBM\Bus\Dispatcher::class)->unregister($event->job);
});

use Illuminate\Contracts\Queue\ShouldQueue;
use \MBM\Bus\AllowDuplicates
 
class CustomJob implements ShouldQueue, AllowDuplicates
{
    // Code
}

$ php artisan migrate