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.

v1.0.0(9mo ago)11212MITPHPPHP ^8.3CI passing

Since Jul 20Pushed 9mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (11)Versions (2)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/7592d340e2de1142fa869382b819654d6a0bf7baf8e3c8aded777d652d68c01a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31322e782d6666326432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](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

35

—

LowBetter than 79% of packages

Maintenance57

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

296d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/888105bd54b6b7f7905523a16a1d08eebc2e5d39b19a4c174b5961bb4d52929b?d=identicon)[Grazulex](/maintainers/Grazulex)

---

Top Contributors

[![Grazulex](https://avatars.githubusercontent.com/u/4521546?v=4)](https://github.com/Grazulex "Grazulex (36 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (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

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)

PHPackages © 2026

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