Skip to content

Installation

This guide will help you to install the package in your laravel project.

Require package

The first thing to do is to install packet if it has not already been done.

composer require patchlevel/laravel-event-sourcing=1.0.0-beta3

Note

how to install composer

Configuration

Next you need to publish the event sourcing config file. It will be published to config/event-sourcing.php

php artisan vendor:publish --tag patchlevel-config

Migrations

You can publish the migrations with the following command:

php artisan vendor:publish --tag patchlevel-migrations
And then run the migrations:

php artisan migrate

Middlewares

Some features need a middleware to work properly. You should add the middleware to your bootstrap/app.php file.

use Patchlevel\LaravelEventSourcing\Middleware\EventSourcingMiddleware;

->withMiddleware(static function (Middleware $middleware): void {
    $middleware->append(EventSourcingMiddleware::class);
})

Success

You have successfully installed the package! You can now start using the event sourcing library in your laravel project. Start with the quickstart to get a feeling for the package.

Note

This documentation is limited to the package integration. You should also read the library documentation.