PHPackages                             grazulex/laravel-snapshot - 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. [Database &amp; ORM](/categories/database)
4. /
5. grazulex/laravel-snapshot

ActiveLibrary[Database &amp; ORM](/categories/database)

grazulex/laravel-snapshot
=========================

A powerful Laravel package for tracking, storing and comparing snapshots of your Eloquent models — cleanly and safely.

v2.0.0(1mo ago)11663MITPHPPHP ^8.3CI passing

Since Jul 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Grazulex/laravel-snapshot)[ Packagist](https://packagist.org/packages/grazulex/laravel-snapshot)[ Docs](https://github.com/grazulex/laravel-snapshot)[ Fund](https://www.buymeacoffee.com/Grazulex)[ Fund](https://paypal.me/strauven)[ RSS](/packages/grazulex-laravel-snapshot/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (22)Versions (3)Used By (0)

Laravel Snapshot
================

[](#laravel-snapshot)

 [![Laravel Snapshot](new_logo.png)](new_logo.png)**Advanced model versioning and snapshot system for Laravel applications**

[![Latest Version](https://camo.githubusercontent.com/b5ff8f83d93fca2e3246a5c94d5c7437490362eb6b7620a4734ef7fc3aa1baf9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772617a756c65782f6c61726176656c2d736e617073686f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-snapshot)[![Total Downloads](https://camo.githubusercontent.com/9350255c2856b92deaa7aebdf4685eb215fc3bafeeaf30f672d0b53e6e4e4a7e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772617a756c65782f6c61726176656c2d736e617073686f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grazulex/laravel-snapshot)[![License](https://camo.githubusercontent.com/f6a3f6921267916977d10bb79af03d8d907ba217d3e47b226ab1dd85d7bc4f92/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6772617a756c65782f6c61726176656c2d736e617073686f742e7376673f7374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-snapshot/blob/main/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/a5fb01758626940e433ed9da0dd085104f524373a85dfb444f2b68332ef492c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772617a756c65782f6c61726176656c2d736e617073686f742e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/0f9124670edba5a2f077bb75feb4d6d421cca2a109935a5c268e380934334f72/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31332e782d6666326432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com/)[![Tests](https://camo.githubusercontent.com/ec0df4e27fe4d9d5c02a73f5e6d9e3df565e640613c4c73ebe4ada30246781a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772617a756c65782f6c61726176656c2d736e617073686f742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/Grazulex/laravel-snapshot/actions)[![Code Style](https://camo.githubusercontent.com/161d70e6871f808e0439b3e7a86540993ae98775540b5a2e78226000e3c419c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d3030303030303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://github.com/laravel/pint)

Overview
--------

[](#overview)

Laravel Snapshot is a powerful package for tracking, storing and comparing snapshots of your Eloquent models — cleanly and safely. Perfect for audit trails, data recovery, debugging, and version control of your Laravel applications.

✨ Features
----------

[](#-features)

- � **Manual &amp; Automatic Snapshots** - Capture model state on demand or automatically
- 🔄 **Model Restoration** - Restore models to any previous snapshot state
- 📊 **Smart Comparisons** - Deep diff analysis between snapshots
- 💾 **Multiple Storage Backends** - Database, file system, or in-memory storage
- 📈 **Rich Analytics** - Statistics, change frequency, and trend analysis
- ⚡ **CLI Commands** - Full command-line interface for all operations
- 🧪 **Testing Support** - Built with Pest 3 and extensive test coverage
- ✅ **Production Ready** - PHPStan level 5, optimized performance

� Quick Installation
--------------------

[](#-quick-installation)

```
# Install the package
composer require grazulex/laravel-snapshot

# Publish config (optional)
php artisan vendor:publish --tag=snapshot-config

# Run migrations
php artisan migrate
```

� Documentation
---------------

[](#-documentation)

**All documentation, examples, and guides are now available in our comprehensive Wiki:**

### 📚 [**Visit the Laravel Snapshot Wiki →**](https://github.com/Grazulex/laravel-snapshot/wiki)

[](#-visit-the-laravel-snapshot-wiki-)

**Quick Navigation:**

TopicLink🏁 **Getting Started**[Installation &amp; Setup](https://github.com/Grazulex/laravel-snapshot/wiki/Installation)📘 **Basic Usage**[Creating &amp; Managing Snapshots](https://github.com/Grazulex/laravel-snapshot/wiki/Basic-Usage)⚙️ **Configuration**[Configuration Options](https://github.com/Grazulex/laravel-snapshot/wiki/Configuration)🔄 **Model Restoration**[Restoring Previous States](https://github.com/Grazulex/laravel-snapshot/wiki/Model-Restoration)📊 **Analytics &amp; Reports**[Statistics &amp; Analytics](https://github.com/Grazulex/laravel-snapshot/wiki/Analytics)⚡ **CLI Commands**[Command Reference](https://github.com/Grazulex/laravel-snapshot/wiki/CLI-Commands)💡 **Examples**[Real-world Examples](https://github.com/Grazulex/laravel-snapshot/wiki/Examples)🧪 **Testing**[Testing Your Implementation](https://github.com/Grazulex/laravel-snapshot/wiki/Testing)🔧 **Advanced Usage**[Advanced Features](https://github.com/Grazulex/laravel-snapshot/wiki/Advanced-Usage)🚀 **API Reference**[Complete API Documentation](https://github.com/Grazulex/laravel-snapshot/wiki/API-Reference)💡 Quick Example
---------------

[](#-quick-example)

```
use Grazulex\LaravelSnapshot\Traits\HasSnapshots;

class Order extends Model
{
    use HasSnapshots;
}

// Create snapshots
$order = Order::find(1);
$order->snapshot('before-discount');

$order->update(['total' => 99.99]);
$order->snapshot('after-discount');

// Compare and restore
$diff = $order->compareWithSnapshot('before-discount');
$order->restoreFromSnapshot('before-discount');

// CLI usage
php artisan snapshot:save "App\Models\Order" --id=1 --label=backup
php artisan snapshot:restore "App\Models\Order" 1 backup
php artisan snapshot:diff before-discount after-discount
```

🎯 Use Cases
-----------

[](#-use-cases)

Perfect for:

- **Financial Systems** - Transaction history and audit trails
- **Content Management** - Version control for articles and pages
- **E-commerce** - Product and order change tracking
- **Data Recovery** - Point-in-time data restoration
- **Compliance** - Regulatory audit trail requirements
- **Debugging** - Track state changes during development

🔧 Requirements
--------------

[](#-requirements)

- **PHP**: ^8.3
- **Laravel**: ^12.19
- **Carbon**: ^3.10

🧪 Quality Assurance
-------------------

[](#-quality-assurance)

- ✅ **95 Tests** passing with Pest 3
- ✅ **PHPStan Level 5** compliance
- ✅ **60%+ Code Coverage**
- ✅ **Laravel Pint** code style
- ✅ **Comprehensive CLI** testing

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Commands

[](#development-commands)

```
composer run-script full    # Run all quality checks
composer run-script test    # Run tests
composer run-script pint    # Fix code style
composer run-script phpstan # Static analysis
```

🔒 Security
----------

[](#-security)

If you discover a security vulnerability, please review our [Security Policy](SECURITY.md).

📄 License
---------

[](#-license)

Laravel Snapshot is open-sourced software licensed under the [MIT license](LICENSE.md).

---

**📚 [Complete Documentation](https://github.com/Grazulex/laravel-snapshot/wiki) | 💬 [Discussions](https://github.com/Grazulex/laravel-snapshot/discussions) | � [Issues](https://github.com/Grazulex/laravel-snapshot/issues)**

Made with ❤️ for the Laravel community

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~303 days

Total

2

Last Release

45d ago

Major Versions

v1.0.0 → v2.0.02026-05-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4521546?v=4)[Jean-Marc Strauven](/maintainers/Grazulex)[@Grazulex](https://github.com/Grazulex)

---

Top Contributors

[![Grazulex](https://avatars.githubusercontent.com/u/4521546?v=4)](https://github.com/Grazulex "Grazulex (37 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (9 commits)")[![dogmaxpeppe](https://avatars.githubusercontent.com/u/1201742?v=4)](https://github.com/dogmaxpeppe "dogmaxpeppe (9 commits)")

---

Tags

laravelmodelpackagephpsnapshotdifflaravelsnapshotbackupeloquenttrackingserializationcomparisonversioningAuditmodel-snapshotstate-capture

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/grazulex-laravel-snapshot/health.svg)

```
[![Health](https://phpackages.com/badges/grazulex-laravel-snapshot/health.svg)](https://phpackages.com/packages/grazulex-laravel-snapshot)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M307](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
