Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 committed Mar 22, 2024
1 parent f01c359 commit 6529a98
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ composer require mansoor/filament-versionable

## Usage

Add `Overtrue\LaravelVersionable\Versionable` trait to your model and set versionable attributes:
Add `Overtrue\LaravelVersionable\Versionable` trait to your model and set `$versionable` attributes.

**NOTE: Make sure to add protected $versionStrategy = VersionStrategy::SNAPSHOT; This would save all the $versionable attributes when any of them changed. There are different bug reports on using VersionStrategy::DIFF**

```php
use Overtrue\LaravelVersionable\VersionStrategy;

class Post extends Model
{
use Overtrue\LaravelVersionable\Versionable;

protected $versionable = ['title', 'content'];

protected $versionStrategy = VersionStrategy::SNAPSHOT;
}
```

Expand Down

0 comments on commit 6529a98

Please sign in to comment.