1. Go to this page and download the library: Download hasel/aphpsurd-bundle 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 Hasel\AphpsurdBundle\Attribute\AsAbsurdTask;
use Ruudk\Absurd\Task\Context;
#[AsAbsurdTask('send-invitations', queue: 'notifications')]
final class SendInvitationsTask
{
public function __invoke(SendInvitationsPayload $params, Context $ctx): mixed
{
// ...
}
}
use Hasel\AphpsurdBundle\AbsurdClientInterface;
final class OrderController
{
public function __construct(private AbsurdClientInterface $absurd) {}
public function checkout(): Response
{
$this->absurd->spawn(new SendInvitationsPayload($orderId));
$this->absurd->emitEvent('order.confirmed', ['orderId' => $id]);
// ...
}
}