PHPackages                             makidizajnerica/laravel-snapshoter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. makidizajnerica/laravel-snapshoter

ActiveLibrary[Framework](/categories/framework)

makidizajnerica/laravel-snapshoter
==================================

Laravel model snapshoter.

v4.0(11mo ago)115MITPHPPHP &gt;=8.0

Since Jul 26Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/MakiDizajnerica/laravel-snapshoter)[ Packagist](https://packagist.org/packages/makidizajnerica/laravel-snapshoter)[ Docs](https://github.com/MakiDizajnerica/laravel-snapshoter)[ RSS](/packages/makidizajnerica-laravel-snapshoter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (14)Used By (0)

Laravel Snapshoter
==================

[](#laravel-snapshoter)

Laravel model snapshoter. Make snapshots for the models, revert model state to previous snapshot.

Installation
------------

[](#installation)

```
composer require makidizajnerica/laravel-snapshoter
```

Publish migrations using:

```
php artisan vendor:publish --tag=snapshoter-migrations
```

After that be sure to run migrations to generate `snapshots` table:

```
php artisan migrate
```

Then publish config file `snapshoter.php` using:

```
php artisan vendor:publish --tag=snapshoter-config
```

Usage
-----

[](#usage)

Your model needs to implement `MakiDizajnerica\Snapshoter\Contracts\Snapshotable` and also to use `MakiDizajnerica\Snapshoter\HasSnapshots` trait. Next define `snapshotFields` method that will return model attributes you want to save to the snapshots:

```
