1. Go to this page and download the library: Download complex-heart/domain-events 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/ */
complex-heart / domain-events example snippets
use ComplexHeart\Domain\Contracts\Events\Event;
use ComplexHeart\Domain\Events\IsDomainEvent;
final class OrderPlaced implements Event
{
use IsDomainEvent;
public function __construct(
public readonly string $orderId,
public readonly string $customerId,
public readonly float $total,
) {
}
}