Skip to content

Commit 3f44bf3

Browse files
committed
Merge branch 'main' of github.com:inmanturbo/ecow
2 parents e2046c0 + cbfb22c commit 3f44bf3

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Changelog
22

33
All notable changes to `ecow` will be documented in this file.
4+
5+
## v1.0.0 - 2024-08-07
6+
7+
**Full Changelog**: https://github.com/inmanturbo/ecow/commits/v1.0.0

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/inmanturbo/ecow/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/inmanturbo/ecow/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/inmanturbo/ecow.svg?style=flat-square)](https://packagist.org/packages/inmanturbo/ecow)
77

8-
## Eloquent copy-on-write: automatically copy all model changes to a seperate table.
8+
## Eloquent copy-on-write: automatically copy all model changes to a separate table.
99

1010
<img src="art/ecow.svg" width="200px" alt="ecow" />
1111

@@ -124,7 +124,7 @@ $clone->fakeField;
124124
// 'this is some fake data'
125125
```
126126

127-
It's recommended in most cases you use a clone when retreiving models, rather than modifying the original model, as adding a bunch of arbitrary properties from the history to say, auth()->user() at run time could have unexpected results.
127+
It's recommended in most cases you use a clone when retrieving models, rather than modifying the original model, as adding a bunch of arbitrary properties from the history to say, `auth()->user()` at runtime could have unexpected results.
128128

129129
### Snapshotting Models
130130

@@ -167,7 +167,7 @@ php artisan ecow:replay-models
167167

168168
This will truncate all recorded models and replay through all of their built up state using current application logic.
169169

170-
### Excluding models from Ecow listeners.
170+
### Excluding models from Ecow listeners
171171

172172
Some models you may not want to be recorded. You can add their class names to the `unsaved_models` array in the `ecow.php` config file.
173173

@@ -214,7 +214,7 @@ return [
214214
```
215215

216216
### Overriding the `modelware` pipelines
217-
This package sends the event data through [pilelines](https://laravel.com/docs/11.x/helpers#pipeline) (similiar to middleware), which iterate thorugh collections of invokable classes, these collections are bound into and resolved from the service container. They can be replaced or overridden in the boot method of a service provider using the following syntax:
217+
This package sends the event data through [pilelines](https://laravel.com/docs/11.x/helpers#pipeline) (similiar to middleware), which iterate through collections of invokable classes, these collections are bound into and resolved from the service container. They can be replaced or overridden in the boot method of a service provider using the following syntax:
218218

219219
```php
220220
app()->bind("ecow.{$event}", function () use ($pipes) {
@@ -276,7 +276,7 @@ app()->bind(\Inmanturbo\Ecow\Pipeline\InitializeData::class, \App\Pipeline\Initi
276276

277277
### Disabling the Ecow Event listeners
278278

279-
You can disable ecow listeners at run time with `Ecow::disable()`
279+
You can disable ecow listeners at runtime with `Ecow::disable()`
280280

281281
```php
282282
use Inmanturbo\Ecow\Facades\Ecow;
@@ -305,7 +305,7 @@ return [
305305

306306
### A note on model keys
307307

308-
The practice used here is event sourcing, which is best served by using `uuids`, or `guids`, as the model's id could not otherwise be known or globally identifiable, prior to it being committed to the database. However, for convenience, standard auto-incrementing keys are supported by the package, by backfilling the auto-incremented key on the creating event if there is no `uuid`, after the model is created. This requires the package to create the model itself and halt the creating event by returning `false`. The package will also store a guid property in its own table whenever a model is first created. Otherwise updating stored event history is usually a big no-no and is it's definately not recommended. It is only done by the package on creating/created as a workaround.
308+
The practice used here is event sourcing, which is best served by using `uuids`, or `guids`, as the model's id could not otherwise be known or globally identifiable, prior to it being committed to the database. However, for convenience, standard auto-incrementing keys are supported by the package, by backfilling the auto-incremented key on the creating event if there is no `uuid`, after the model is created. This requires the package to create the model itself and halt the creating event by returning `false`. The package will also store a guid property in its own table whenever a model is first created. Otherwise updating stored event history is usually a big no-no and it's definately not recommended. It is only done by the package on creating/created as a workaround.
309309

310310
Also supported, and perhaps the most preferred is using both a `uuid` and (auto incremented) `id` column on your models' tables. Whenever a column called `uuid` is used, `$model->uuid` will be used by the package instead of `$model->getKey()` for recording model versions.
311311

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "inmanturbo/ecow",
3-
"description": "Eloquent copy-on-write: automatically copy all model changes to a seperate table.",
3+
"description": "Eloquent copy-on-write: automatically copy all model changes to a separate table.",
44
"keywords": [
55
"inmanturbo",
66
"laravel",

0 commit comments

Comments
 (0)