|
8 | 8 | - Annotation, Yaml and Xml mapping support for extensions
|
9 | 9 |
|
10 | 10 | ### Installation
|
| 11 | +* To get Loggable working you'll have needed to follow the following prerequisites; |
| 12 | + 1. Install Laravel doctrine ORM package `composer require laravel-doctrine/orm` |
| 13 | + 1. [Optional] If you intend to use the `fluent` driver for schema then you'll need to install Laravel doctrine fluent `composer require laravel-doctrine/fluent`. Please note that this is __NOT__ required if you're using the annotations method. |
| 14 | + 2. Install Laravel doctrine extension package `composer require laravel-doctrine/extensions` |
| 15 | + 3. Install Gedmo doctrine extension package `composer require gedmo/doctrine-extensions` |
| 16 | +* Add `LaravelDoctrine\Extensions\Loggable\LoggableExtension` to the `extensions` array in `doctrine.php` located within the `config` directory of Laravel. |
| 17 | +``` |
| 18 | +'extensions' => [ |
| 19 | + //LaravelDoctrine\ORM\Extensions\TablePrefix\TablePrefixExtension::class, |
| 20 | + //LaravelDoctrine\Extensions\Timestamps\TimestampableExtension::class, |
| 21 | + //LaravelDoctrine\Extensions\SoftDeletes\SoftDeleteableExtension::class, |
| 22 | + //LaravelDoctrine\Extensions\Sluggable\SluggableExtension::class, |
| 23 | + //LaravelDoctrine\Extensions\Sortable\SortableExtension::class, |
| 24 | + //LaravelDoctrine\Extensions\Tree\TreeExtension::class, |
| 25 | + LaravelDoctrine\Extensions\Loggable\LoggableExtension::class, |
| 26 | + //LaravelDoctrine\Extensions\Blameable\BlameableExtension::class, |
| 27 | + //LaravelDoctrine\Extensions\IpTraceable\IpTraceableExtension::class, |
| 28 | + //LaravelDoctrine\Extensions\Translatable\TranslatableExtension::class |
| 29 | +], |
| 30 | +``` |
11 | 31 |
|
12 |
| -Add `LaravelDoctrine\Extensions\Loggable\LoggableExtension` to `doctrine.extensions` config. |
| 32 | +* Add Gedmo loggable listeners into the `events` array in `doctrine.php` located within the `config` directory of Laravel. |
| 33 | +``` |
| 34 | +'listeners' => [ |
| 35 | + Gedmo\Loggable\LoggableListener::class, |
| 36 | +], |
| 37 | +``` |
| 38 | + |
| 39 | +* Enable Gedmo mappings in the `gedmo` array in `doctrine.php` located within the `config` directory of Laravel. |
| 40 | +``` |
| 41 | +'gedmo' => [ |
| 42 | + 'all_mappings' => true, |
| 43 | +] |
| 44 | +``` |
13 | 45 |
|
14 | 46 | ### Class annotation
|
15 | 47 |
|
|
0 commit comments