surgio/eloquent-message-repository
This package allows you to use Eloquent as a custom message repository for EventSauce.
Heavily inspired by EventSaucePHP/DoctrineMessageRepository.
This package requires PHP 8.2 and Laravel 10 or higher.
composer require surgio/eloquent-message-repository:^4.0.0
Publish the migration:
php artisan vendor:publish --provider="Surgio\EloquentMessageRepository\EventSauceServiceProvider" --tag="migrations"
Migrate your database:
php artisan migrate
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())
);
You can run the tests with:
composer test
How can I help you explore Laravel packages today?