Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Memento Laravel Package

tabuna/memento

Memento is a Laravel package for tracking changes to Eloquent models. It stores model snapshots so you can review revision history and restore previous states, adding lightweight auditing without complex setup.

View on GitHub
Deep Wiki
Context7

Easy cache store for only stores the result within a single request or job

Frequently asked questions about Memento
How do I install tabuna/memento in a Laravel application?
Install it with composer require tabuna/memento and then follow the package's own setup steps from the repository README, including publishing any configuration or running migrations if it ships them. As a standard Laravel package it relies on Composer auto-discovery, so manual service provider registration is normally unnecessary. Before rolling it out, capture one snapshot in a test to confirm the install works in your application.
Does Memento support Laravel 10 and PHP 8.2?
Yes. The 3.0.0 release aligns Memento with Laravel 10, PHP 8.2, and PHPUnit 10, making it the correct pin for services already on that stack. If your application is still on Laravel 9 or PHP 8.1, you should stay on the 2.x line instead. Composer's constraint solver blocks incompatible combinations, so you get a dependency conflict rather than a runtime surprise.
Can I use Memento on Laravel 8 or 9 with PHP 8.1?
Memento 3.x targets Laravel 10 and PHP 8.2, so applications on Laravel 8/9 or PHP 8.0/8.1 should pin ^2.0 explicitly. Record that constraint as technical debt with a target date tied to your PHP 8.2 upgrade rather than treating it as a permanent state. The failure mode is a resolvable Composer conflict, not a silent runtime break, so the risk stays manageable while the pin is documented.
How do I capture a snapshot of an Eloquent model's state?
Memento exposes a fluent API for capturing object state at any point in a workflow, so you call it from the place in your domain code where the snapshot actually matters. The package is designed to stay storage-agnostic, which means your model code doesn't need to know where the snapshot is persisted. Check the README for the exact method names on your installed version before wiring it into a service class.
How do I restore a model to a previous state with Memento?
Restoring uses the same fluent surface as capture, letting you return a model to a state you saved earlier. Because storage details stay out of your domain code, the restore call reads as ordinary business logic rather than persistence plumbing. Re-test the restore path after upgrading to 3.0.0, since behavioral changes beyond the Composer constraints are not documented in the changelog.
Where are snapshots stored, and can I change the storage layer?
Snapshot storage is configurable and storage-agnostic by design, so you can adapt it to whichever persistence layer fits your application. The 3.0.0 changelog does not disclose new configuration keys or migrations, so verify the current setup against the README for your version. Keep the storage concern configured at the Laravel service level and out of your domain layer.
Does storing snapshots add significant overhead in production?
Snapshots are persisted as ordinary records, so overhead scales with how often you capture state rather than with the size of your codebase. Capture at meaningful workflow points instead of on every attribute change to keep write volume predictable. Memento is positioned as lightweight auditing rather than full event sourcing, so it should not dominate your write path.
How do I test Memento snapshot behavior with PHPUnit?
Memento's own CI validates against PHPUnit 10 as of 3.0.0, but that is a dev dependency and does not constrain your test suite. Write feature tests that capture a snapshot, mutate the model, and assert the restored state matches the original. If you are still on PHPUnit 9 your tests remain valid; only the package's internal coverage narrows.
How does Memento compare with event sourcing or an activity log package?
Memento targets explicit, readable snapshots rather than complex event sourcing, so it is a poor fit if you need full event replay or projections. Compared with general activity-log packages, it focuses on capturing and restoring model state instead of recording a broad audit feed. Choose it when developers need to compare or revisit previous states with minimal boilerplate.
Is tabuna/memento actively maintained, and what changed in 3.0.0?
Memento ships under the esplora vendor, and the 3.0.0 release bumps platform requirements to Laravel 10, PHP 8.2, and PHPUnit 10. That release arrived via a first-time contributor in PR #1 with a sparse changelog, so review depth and bus factor are worth flagging before adopting it in a critical service. Confirm the maintainer's release cadence and support policy on the repository.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource