Download the PHP package spiral-packages/cqrs without Composer
On this page you can find all versions of the php package spiral-packages/cqrs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spiral-packages/cqrs
More information about spiral-packages/cqrs
Files in spiral-packages/cqrs
Package cqrs
Short Description Lightweight message bus supporting CQRS for Spiral Framework
License MIT
Homepage https://github.com/spiral-packages/cqrs
Informations about the package cqrs
(CQRS) Command/Query bus implementation for Spiral Framework
It's a lightweight messaging facade. It allows you to define the API of your model with the help of messages.
- Command messages describe actions your model can handle.
- Query messages describe available information that can be fetched from your (read) model.
Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
- Spiral framework 3.0+
Installation
You can install the package via composer:
After package install you need to register bootloader from the package.
Note: if you are using
spiral-packages/discoverer
, you don't need to register bootloader by yourself.
Usage
You can also register command and query handlers via attributes
Commands
Command definition
Command handler definition
To register command handler you just need to add attribute on method that should be invoked.
Dispatch command
Queries
Query definition
Query handler definition
Dispatch queries
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of cqrs with dependencies
spiral/boot Version ^3.0
spiral/core Version ^3.0
spiral/config Version ^3.0
spiral/attributes Version ^3.0
spiral/console Version ^3.0
spiral/tokenizer Version ^3.0
symfony/messenger Version ^6.0