PHP code example of urfysoft / transactional-outbox
1. Go to this page and download the library: Download urfysoft/transactional-outbox 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/ */
urfysoft / transactional-outbox example snippets
namespace App\Messaging;
use Urfysoft\TransactionalOutbox\Contracts\InboxEventHandler;
use Urfysoft\TransactionalOutbox\Models\InboxMessage;
class PaymentCompletedHandler implements InboxEventHandler
{
public function eventType(): string
{
return 'PaymentCompleted';
}
public function handle(InboxMessage $message): void
{
// process payload...
}
}
use TransactionalOutbox;
use App\Messaging\PaymentCompletedHandler;
TransactionalOutbox::registerInboxHandler(new PaymentCompletedHandler());