chocofamilyme / laravel-eventsauce
Laravel Eventsauce integration
Requires
- php: ^7.2
- ext-json: *
- eventsauce/eventsauce: ^0.8.0
- illuminate/bus: ^5.7|^5.8|^6.0
- illuminate/container: ^5.7|^5.8|^6.0
- illuminate/queue: ^5.7|^5.8|^6.0
- illuminate/support: ^5.7|^5.8|^6.0
- ramsey/uuid: ^3.8
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ^3.7.6|^3.8|^4.0
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-10-29 05:59:24 UTC
README
Laravel adapter for EventSauce. Before using this package you should already know how to work with EventSauce.
Requirements
- PHP ^7.2
- Laravel ^5.8
Installation
Via Composer
composer require chocofamilyme/laravel-eventsauce
Migrations
You can publish and modify default migrations tables (domain_messages
, snapshots
) with the following command:
php artisan vendor:publish --tag="eventsauce-migrations"
php artisan migrate
Configuration
You can publish the config file with the following command:
php artisan vendor:publish --tag="eventsauce-config"
Code Generation
Types, commands and events can be generated starting from a yaml file. Here you can specify the input and the output of the code generation. More info on code generation here: https://eventsauce.io/docs/getting-started/create-events-and-commands
Default Connection
The default database connection can be modified by setting the EVENTSAUCE_CONNECTION
env variable:
EVENTSAUCE_CONNECTION=mysql
Default Message Table
The default table name for your domain messages can be set with the EVENTSAUCE_TABLE
env variable:
EVENTSAUCE_TABLE=domain_messages
Default Snapshot Table
The default table name used to store snapshots can be set with the EVENTSAUCE_SNAPSHOT_TABLE
env variable:
EVENTSAUCE_SNAPSHOT_TABLE=snapshots
Default Message Repository
This class will be used to store messages. You may change this to any class that implements EventSauce\EventSourcing\MessageRepository
, by default used Chocofamily\LaravelEventSauce\MessageRepository::class
Default Snapshot Repository
This class will be used to store snapshots. You may change this to any class that implements EventSauce\EventSourcing\Snapshotting\SnapshotRepository
, by default used Chocofamily\LaravelEventSauce\SnapshotRepository::class
Default Consumer Handler
This class will be used to put message on the handlers, by default used Chocofamily\LaravelEventSauce\ConsumerHandler::class
Usage
TODO
License
license. Please see the license file for more information.