jsellis / eloquent-message-repository
Eloquent Message Repository for EventSauce
v1.0.3
2018-06-22 18:52 UTC
Requires
- eventsauce/eventsauce: ^0.3.0
- ramsey/uuid: ^3.7
Requires (Dev)
- orchestra/testbench: ~3.0
- phpunit/phpunit: ^7.2
This package is not auto-updated.
Last update: 2025-02-16 07:44:07 UTC
README
This package allows you to use Eloquent as a custom message repository for EventSauce.
Heavily inspired by EventSaucePHP/DoctrineMessageRepository.
Requirements
This package requires PHP 7.2 and Laravel 5.6 or higher.
Installation
composer require jsellis/eloquent-message-repository:^1.0.0
Setup
Publish the migration:
php artisan vendor:publish --provider="JSellis\EloquentMessageRepository\EventSauceServiceProvider" --tag="migrations"
Migrate your database:
php artisan migrate
Usage
The Eloquent Message Repository implements EventSauce\EventSourcing\MessageRepository
and can be passed to any AggregateRootRepository
like so:
$aggregateRootRepository = new ConstructingAggregateRootRepository(
SomeProcess::class,
new EloquentMessageRepository(new ConstructingMessageSerializer())
);
Testing
You can run the tests with:
composer test