- What does mpociot/reanimate do in Laravel?
- Reanimate adds a trait to Eloquent models so each save stores a revision of the model's attributes. You can then replay that stored history step by step through a simple callback to animate transitions between states. It is intended for dashboards, timelines, and views that show how a record evolved.
- How do I install mpociot/reanimate?
- Install it with composer require mpociot/reanimate in your Laravel application. The package ships with a drop-in service provider, and you add the Reanimate trait to the Eloquent models you want to track. Review or publish any configuration for revision storage before using it in production.
- Does Reanimate require database migrations or soft-delete columns?
- The provided context says the soft-delete/recycle-bin use case requires no schema change or data migration and does not add soft-delete columns. Revisions are described as using configurable storage, so confirm whether that means a separate table, driver, or snapshot store. Always verify the installed version against your own schema and retention requirements.
- Which Laravel and PHP versions does mpociot/reanimate support?
- The supplied context does not list exact illuminate/* or PHP version constraints. Check the repository's composer.json and latest release before adopting it. Because the package is small, a short install spike is the fastest way to confirm compatibility with your Laravel version.
- How does replaying model history work with Reanimate?
- After changes are captured, Reanimate lets you walk through the stored history step by step using a simple callback. That makes it possible to animate transitions between attribute states for timelines or record-evolution views. Test the ordering and payload shape with representative data before building UI around it.
- Is Reanimate a soft-delete recycle bin or a revision tracking package?
- The overview describes revision tracking and replay of Eloquent attribute changes, while another description calls it a recycle bin for deleted models without soft-delete columns. Those are materially different mechanisms with different security and compliance implications. Read the package source and composer metadata before assuming restore or snapshot behavior.
- How should I secure restore or replay endpoints in production?
- Treat Reanimate as a data-access mechanism, not an authorization layer. Put any restore or replay route behind your Laravel policies, tenant scoping, middleware, and an explicit trashed check where relevant. Add audit logging and retention rules around any sensitive snapshot data the package stores.
- Does Reanimate cascade restores across Eloquent relationships?
- The context identifies cascading restore of a parent plus soft-deleted children as the genuinely non-trivial capability, but cascade semantics should not be assumed as a default. Verify restore order, foreign-key constraints, polymorphic relations, deep cascades, UUID/ULID keys, and multi-tenancy against your real schema. Wrap multi-record restores in a transaction so a partial cascade cannot leave unintended state.
- Can I use Reanimate if my application uses hard deletes?
- Reanimate cannot recover records that have been hard-deleted because the data no longer exists. Its recovery use case assumes Laravel SoftDeletes are used consistently across the relevant models. If soft deletes are sporadic, fix the data model first or limit adoption to models where reversible deletion is an explicit product decision.
- Is mpociot/reanimate actively maintained and safe to depend on?
- The context cites roughly 122 stars, zero dependents, a single maintainer, and best-effort upstream maintenance. Pin the version, vendor or fork it, and treat an in-house reimplementation as a scoped afternoon rather than a rewrite. For a data-recovery path, do a source review and integration spike before production adoption.