PHP code example of arispati / laravel-dispatch-id

1. Go to this page and download the library: Download arispati/laravel-dispatch-id 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/ */

    

arispati / laravel-dispatch-id example snippets


use Arispati\LaravelDispatchId\Event;
use App\Jobs\TestJob;

// Basic dispatch
$jobId = Event::dispatch(new TestJob());

// Advanced dispatch
$job = (new TestJob())->delay(now()->addMinutes(10))
    ->onConnection('connection')
    ->onQueue('queue');
$jobId = Event::dispatch($job);

use App\Jobs\TestJob;

// Basic dispatch
$jobId = dispatch_id(new TestJob());

// Advanced dispatch
$job = (new TestJob())->delay(now()->addMinutes(10))
    ->onConnection('connection')
    ->onQueue('queue');
$jobId = dispatch_id($job);