1. Go to this page and download the library: Download tetthys/claim-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/ */
tetthys / claim-dispatch example snippets
// app/Processors/WelcomeEmailProcessor.php
namespace App\Processors;
use Tetthys\ClaimDispatch\Contracts\LogProcessorInterface;
use Tetthys\ClaimDispatch\Contracts\LogRecordInterface;
use App\Jobs\SendWelcomeEmail;
final class WelcomeEmailProcessor implements LogProcessorInterface
{
public function supports(string $type): bool
{
return $type === 'email.welcome';
}
public function toJob(LogRecordInterface $record): object
{
$p = $record->getPayload();
return new SendWelcomeEmail((string) ($p['user_email'] ?? ''));
}
}