PHPackages                             braankoo/eloquent-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. braankoo/eloquent-snapshot

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

braankoo/eloquent-snapshot
==========================

Laravel Eloquent Snapshot is a lightweight package that enables automatic or manual snapshots of Eloquent model states. Ideal for audit trails, change tracking, or rollback functionality, this package stores historical records of model data in a flexible and efficient way.

v1.0.1(11mo ago)01MITPHP

Since Jun 8Pushed 11mo agoCompare

[ Source](https://github.com/braankoo/laravel-eloquent-snapshot)[ Packagist](https://packagist.org/packages/braankoo/eloquent-snapshot)[ RSS](/packages/braankoo-eloquent-snapshot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Eloquent Snapshot
=================

[](#eloquent-snapshot)

Eloquent Snapshot is a Laravel package that provides functionality for storing and restoring snapshots of Eloquent models. This is useful for tracking changes, creating backups, or implementing undo functionality in your application.

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

[](#installation)

Install the package via Composer:

```
composer require braankoo/eloquent-snapshot
```

Usage
-----

[](#usage)

### Storing Snapshots

[](#storing-snapshots)

Use the `EloquentSnapshotStoreService` to store snapshots of Eloquent models:

```
use Braankoo\EloquentSnapshot\EloquentSnapshotFacade as Snapshot;

Snapshot::create($model);
Snapshot::create([$model1, $model2]);
Snapshot::create(collect([$model1, $model2]));
```

### Restoring Snapshots

[](#restoring-snapshots)

Use the `EloquentSnapshotRestoreService` to restore snapshots of Eloquent models:

```
use Braankoo\EloquentSnapshot\EloquentSnapshotFacade as Snapshot;
use Braankoo\EloquentSnapshot\EloquentSnapshotFilter;
Snapshot::restore(Model::first()); // Restore the last model snapshot
Snapshot::restore(Model::first(), (new EloquentSnapshotFilter())->first());
Snapshot::restore(Model::first(), (new EloquentSnapshotFilter())->latest());
```

### Filtering Snapshots

[](#filtering-snapshots)

You can filter snapshots using the `EloquentSnapshotFilter` class:

```
use Braankoo\EloquentSnapshot\EloquentSnapshotFilter;
use Braankoo\EloquentSnapshot\EloquentSnapshotFacade as Snapshot;
Snapshot::restore(Model::first(), (new EloquentSnapshotFilter())->before(Carbon::now()->subDays(7))->after(Carbon::now()->subDays(30))->first());
```

Features
--------

[](#features)

- Store snapshots of Eloquent models, arrays, or collections.
- Restore snapshots with optional filtering.
- Transactional operations for data integrity.
- Supports chunked inserts for large datasets.

Configuration
-------------

[](#configuration)

No additional configuration is required. The package uses Laravel's default database connection. All you have to do is run the migrations to create the necessary tables:

```
php artisan migrate
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.

License
-------

[](#license)

This package is open-source and licensed under the MIT License.

```

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance53

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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 ~6 days

Total

2

Last Release

330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71c4e33b5125d03bf0cab411b3502a2997a102ee9ac6156a63cf4cf556b8dcb0?d=identicon)[braankoo](/maintainers/braankoo)

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/braankoo-eloquent-snapshot/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

3593.5k](/packages/baril-bonsai)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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