1. Go to this page and download the library: Download componenta/cqrs-policy 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/ */
componenta / cqrs-policy example snippets
return [
new Componenta\CQRS\ConfigProvider(),
new Componenta\Policy\ConfigProvider(),
new Componenta\CQRS\Policy\ConfigProvider(),
];
use Componenta\Policy\Actor\ActorAwareInterface;
final readonly class PublishPostCommand implements ActorAwareInterface
{
public function __construct(
public object $actor,
public int $postId,
) {}
}
use Componenta\Policy\Actor\ActorAwareInterface;
final readonly class GetMyOrders implements ActorAwareInterface
{
public function __construct(
public object $actor,
) {}
}
return [
new Componenta\CQRS\ConfigProvider(),
new Componenta\Policy\ConfigProvider(),
new Componenta\CQRS\Policy\ConfigProvider(),
new Componenta\CQRS\Transport\ConfigProvider(),
new Componenta\CQRS\Policy\Transport\ConfigProvider(),
];