envor/libstream
最新稳定版本:v1.0.7
Composer 安装命令:
composer require envor/libstream
包简介
This is my package libstream
关键字:
README 文档
README
Installation
You can install the package via composer:
composer require envor/libstream
You can publish and run the migrations with:
php artisan vendor:publish --tag="libstream-migrations"
php artisan migrate
Usage
use Envor\Libstream\Command as LibCommand; use App\Aggregates\Main; #[HandledBy(Main::class)] class Command extends LibCommand { public static function createBusiness( string $uuid, array $businessAttributes, array $metaData = [] ): self { return new self(new BusinessCreated( aggregateUuid: $uuid, businessAttributes: $businessAttributes, metaData: $metaData )); } }
use Envor\Libstream\Dispatcher as LibDispatcher class Dispatcher extends LibDispatcher { public function createBusiness( string $uuid, array $businessAttributes, array $metaData = [] ): self { $this->add(new Command(new BusinessCreated( aggregateUuid: $uuid, businessAttributes: $businessAttributes, metaData: $metaData ))); return $this; } }
$uuid = (string) str()->ulid(); $dispatcher = Dispatcher::new()->createBusiness( uuid: $uuid, businessAttributes: $validatedData, metaData: [ 'auth' => [ 'email' => Auth::user()->email, ], ] )->dispatch();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 84
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-31