-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c541bcf
commit 4b00ff3
Showing
7 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
permalink: /docs/getting-started/introduction/ | ||
redirect_from: /docs/getting-started/ | ||
title: Getting Started | ||
--- | ||
|
||
EventSauce is a pragmatic yet robust event sourcing library for PHP. At the heart of the library | ||
are a set of simple interfaces that make it easy to adapt many types of infrastructure. A set of | ||
ready-made components is there to speed up implementation. This guide will walk you through | ||
the steps needed to set yourself up to start event sourcing. The guide will only focus on | ||
what is relevant to setting up the library. Although there are some framework bindings available, | ||
this guide will use a framework-agnostic point of view. You are expected to make the translation | ||
on how to configure this in your framework of choice. | ||
|
||
In this guide we'll walk to initial setup, setting up tests for your aggregates, and wiring it | ||
to infrastructure. Let's get started! | ||
|
||
## Installation | ||
|
||
To get started, first install EventSauce into your PHP project using | ||
[composer](https://getcomposer.org). | ||
|
||
```bash | ||
composer require eventsauce/eventsauce | ||
``` | ||
|
||
This package contains the core of EventSauce, the interfaces, and generic tools. | ||
|
||
Next up, create your first [aggregate root](/docs/getting-started/create-aggregate-root/)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
permalink: /docs/getting-started/create-aggregate-root/ | ||
title: Create an Aggregate Root | ||
--- | ||
|
||
Our first step is to create an event-sourced aggregate root. This is the software model | ||
we'll create that internally uses events. The aggregate root has functionality to rebuild | ||
itself from stored events. It also has functionality to record and expose new events. | ||
|
||
EventSauce represents an aggregate root internally as an interface. Your model will be an | ||
implementation of that interface. To make it easy, a default implementation is supplied in | ||
the form of a trait, preventing you from having to write some boilerplate code. | ||
|
||
```php | ||
use EventSauce\EventSourcing\AggregateRoot; | ||
use EventSauce\EventSourcing\AggregateRootBehaviour; | ||
|
||
class YourAggregateRoot implements AggregateRoot | ||
{ | ||
use AggregateRootBehaviour; | ||
} | ||
``` |