1. Go to this page and download the library: Download sirsova/laravel-webhooks 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/ */
use Illuminate\Contracts\Bus\QueueingDispatcher;
use SirSova\Webhooks\Jobs\ProcessMessage;
use SirSova\Webhooks\Message;
...
$busDispatcher = app(QueueingDispatcher::class);
$message = new Message('event-type', ['foo' => 'bar']);
$job = new ProcessMessage($message);
//queued message example
$busDispatcher->dispatchToQueue($job->onQueue('webhooks'));
//dispatching in time message
$busDispatcher->dispatch($job);
//queued webhook example
$webhook = new Webhook($message, 'https://example.com');
$job = new ProcessWebhook($webhook);
$busDispatcher->dispatchToQueue($job->onQueue('webhooks'));