componenta/cqrs-policy

Policy middleware integration for Componenta CQRS

Maintainers

Package info

github.com/componenta/cqrs-policy

pkg:composer/componenta/cqrs-policy

Statistics

Installs: 5

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-06-21 11:53 UTC

This package is auto-updated.

Last update: 2026-06-21 12:09:20 UTC


README

Policy middleware package for componenta/cqrs.

Install it when command or query execution must be checked through componenta/policy.

composer require componenta/cqrs-policy

Register the provider:

return [
    new Componenta\CQRS\ConfigProvider(),
    new Componenta\Policy\ConfigProvider(),
    new Componenta\CQRS\Policy\ConfigProvider(),
];

The package keeps the middleware FQCNs stable:

  • Componenta\CQRS\Command\Middleware\PolicyMiddleware
  • Componenta\CQRS\Query\Middleware\PolicyMiddleware

Use #[Allow] from componenta/policy for public commands and queries. ATTR_SKIP_POLICY is a technical flag for cases where authorization already happened earlier, for example worker re-dispatch.