chocofamilyme/laravel-eventsauce

Laravel Eventsauce integration

0.2.4 2020-03-02 08:56 UTC

README

Laravel adapter for EventSauce. Before using this package you should already know how to work with EventSauce.

Latest Stable Version 68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232353334353337362f736869656c64 Total Downloads 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63686f636f66616d696c796d652f6c61726176656c2d6576656e7473617563652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63686f636f66616d696c796d652f6c61726176656c2d6576656e7473617563652f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572 License

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.