Skip to content

Commit

Permalink
Updated readme - changed recommended migrations to prevent errors whe…
Browse files Browse the repository at this point in the history
…n using strict database mode
  • Loading branch information
mattmcdonald-uk committed Nov 28, 2016
1 parent 679aad5 commit e704e62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Provides an Eloquent trait to automatically maintain created_by and updated_by (
## Requirements

* This package requires PHP 5.6+
* It has been tested against Laravel 5.2 (though should work with previous versions of Laravel 5).
* It works with Laravel 5.x (and may work with earlier versions too).

## Installation

Require this package in your `composer.json` and update composer.
Require this package with composer

```php
"wildside/userstamps": "0.1.0"
```
````
composer require wildside/userstamps
````

Migrate your Model's table to include a `created_by` and `updated_by` (and `deleted_by` if using `SoftDeletes`).

```php
$table -> unsignedInteger('created_by') -> after('created_at');
$table -> unsignedInteger('updated_by') -> after('updated_at');
$table -> unsignedInteger('created_by') -> nullable() -> default(null) -> after('created_at');
$table -> unsignedInteger('updated_by') -> nullable() -> default(null) -> after('updated_at');
```

Load the trait in your Model.
Expand Down

0 comments on commit e704e62

Please sign in to comment.