|
5 | 5 | [](https://github.com/inmanturbo/ecow/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
|
6 | 6 | [](https://packagist.org/packages/inmanturbo/ecow)
|
7 | 7 |
|
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. |
9 | 9 |
|
10 | 10 | <img src="art/ecow.svg" width="200px" alt="ecow" />
|
11 | 11 |
|
@@ -124,7 +124,7 @@ $clone->fakeField;
|
124 | 124 | // 'this is some fake data'
|
125 | 125 | ```
|
126 | 126 |
|
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. |
128 | 128 |
|
129 | 129 | ### Snapshotting Models
|
130 | 130 |
|
@@ -167,7 +167,7 @@ php artisan ecow:replay-models
|
167 | 167 |
|
168 | 168 | This will truncate all recorded models and replay through all of their built up state using current application logic.
|
169 | 169 |
|
170 |
| -### Excluding models from Ecow listeners. |
| 170 | +### Excluding models from Ecow listeners |
171 | 171 |
|
172 | 172 | 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.
|
173 | 173 |
|
@@ -214,7 +214,7 @@ return [
|
214 | 214 | ```
|
215 | 215 |
|
216 | 216 | ### 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: |
218 | 218 |
|
219 | 219 | ```php
|
220 | 220 | app()->bind("ecow.{$event}", function () use ($pipes) {
|
@@ -276,7 +276,7 @@ app()->bind(\Inmanturbo\Ecow\Pipeline\InitializeData::class, \App\Pipeline\Initi
|
276 | 276 |
|
277 | 277 | ### Disabling the Ecow Event listeners
|
278 | 278 |
|
279 |
| -You can disable ecow listeners at run time with `Ecow::disable()` |
| 279 | +You can disable ecow listeners at runtime with `Ecow::disable()` |
280 | 280 |
|
281 | 281 | ```php
|
282 | 282 | use Inmanturbo\Ecow\Facades\Ecow;
|
@@ -305,7 +305,7 @@ return [
|
305 | 305 |
|
306 | 306 | ### A note on model keys
|
307 | 307 |
|
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. |
309 | 309 |
|
310 | 310 | 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.
|
311 | 311 |
|
|
0 commit comments