PHPackages                             digitalrisks/lese - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. digitalrisks/lese

ActiveLibrary

digitalrisks/lese
=================

Laravel Event Sourcing Eventstore bridge layer

v1.1.0(5y ago)342MITPHPCI failing

Since May 19Pushed 5y agoCompare

[ Source](https://github.com/digitalrisks/lese)[ Packagist](https://packagist.org/packages/digitalrisks/lese)[ RSS](/packages/digitalrisks-lese/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (7)Versions (4)Used By (0)

Laravel Event Sourcing and Eventstore (lese) Bridge
===================================================

[](#laravel-event-sourcing-and-eventstore-lese-bridge)

Or German for `read` which is somewhat applicable to Event Sourcing. It's almost a good name.

This package swaps out the Event and Snapshot storage model for [Laravel Event Souring](https://docs.spatie.be/laravel-event-sourcing/v1/getting-familiar-with-event-sourcing/introduction) with [EventStore](https://eventstore.com/). EventStore has a few advantages over a database in that it is purpose built for event sourcing.

The package also includes a subscribe command so that you may listen to events origination from other services in your system.

Installation
------------

[](#installation)

First of all let's bring in the package and Laravel Event Sourcing into our Laravel app.

```
composer require digitalrisks/lese
```

Then publish the Laravel Event Sourcing and Lese configuration files.

```
php artisan vendor:publish --provider="Spatie\EventSourcing\EventSourcingServiceProvider" --tag="config"
php artisan vendor:publish --provider="DigitalRisks\Lese\LeseServiceProvider" --tag="config"
```

Then jump into `config/event-sourcing.php` to configure EventStore as our event and snapshot storage repositories.

```
    /*
     * This class is responsible for storing events. To add extra behaviour you
     * can change this to a class of your own. The only restriction is that
     * it should implement \Spatie\EventSourcing\StoredEventRepository.
     */
    'stored_event_repository' => \DigitalRisks\Lese\EventStoreStoredEventRepository::class,

    /*
     * This class is responsible for storing snapshots. To add extra behaviour you
     * can change this to a class of your own. The only restriction is that
     * it should implement \Spatie\EventSourcing\StoredEventRepository.
     */
    'snapshot_repository' => \DigitalRisks\Lese\EventStoreSnapshotRepository::class,
```

Configuration
-------------

[](#configuration)

This is the default content of the config file that will be published at `config/lese.php`

```
