rhyanrandolph/revisionable
Laravel package that keeps a revision history for Eloquent models, automatically logging create, update, and delete changes with user context. Easily inspect past versions, compare field changes, and restore or revert records when needed.
Architecture fit
revisions), so it slots into any Laravel model layer without new infrastructure — no queue, cache, search index, or external service.revisionable_type, revisionable_id, user_id, key, old_value, new_value, timestamps, optional IP/additional fields). This is optimal for "who changed field X from A to B at time T" and weak for "give me the full entity state at revision N," which requires replaying deltas.saved / deleted / restored; opt-in/opt-out per model via $keepRevisionOf / $dontKeepRevisionOf and $revisionEnabled. Fits a domain-model-per-aggregate design; does not fit CQRS/event-sourced designs where revisions should be projections of a real event log.Integration feasibility
use RevisionableTrait, declare the relationship usage in controllers/views. A mid-level Laravel developer is productive in under a day.rhyanrandolph/revisionable but points at jarektkaczyk/revisionable, while virtually all public documentation and Stack Overflow answers target VentureCraft\Revisionable\RevisionableTrait. Namespace, config key names, and publish tags likely diverge. Every tutorial snippet copied into the codebase must be re-validated.Technical risk
Model::query()->update(), bulk inserts, raw SQL, and seeded data. Any compliance use case must assume coverage gaps and be designed around them.user_id and additional_fields typically resolve from the auth/request context; in console commands, queue workers, and scheduled jobs these resolve to null or throw. Silent nulls become an audit finding later.Key questions
composer.json constraints (PHP, illuminate/*) and the actual root namespace of this fork versus VentureCraft?owen-it/laravel-auditing) without a data migration?Stack fit
morphMap, and standard model observers. No conflict with Spatie packages or Octane, provided the trait does not hold request state.Migration path
vendor:publish migration + config, migrate, add trait to a pilot model with an explicit whitelist ($keepRevisionOf) rather than defaulting to all attributes.revisionable_type, revisionable_id, created_at), plus user_id and created_at if the admin UI filters by actor or date range. The default migration does not necessarily give you this.Compatibility
RevisionRepository / presenter interface in your own namespace. Because the storage schema is vendor-specific, this is the difference between a two-day swap and a two-sprint rewrite when the fork is abandoned. Do not let revisionHistory() calls spread into Blade templates and controllers directly.morphMap trap: if you alias class names, set the map before the first revision is written, or historical revisionable_type values become unreadable.Sequencing
::query()->update().owen-it/laravel-auditing and spatie/laravel-activitylog, with an explicit statement of which requirement (audit vs. versioning) you are buying for. Given the low opportunity score, this comparison is the highest-leverage step — the market for this capability is crowded and this fork is not differentiated.$dontKeepRevisionOf.Maintenance
Support
Scaling
revisions table typically becomes the largest table in the schema. Plan partitioning or archival (e.g., move >12 months to cold storage) from the start; rely on $historyLimit / $revisionCleanup for coarse trimming, but verify the cleanup path is actually triggered and does not contend with OLTP traffic.last_seen_at or login_count column is a pure cost with no audit value.Failure modes
user_id from queue/console contexts; additional_fields reading the Request facade throwing outside HTTP. Fail loudly in non-HTTP contexts rather than storing nulls.deleted hook, so hard-deleted records lose their final revision.old_value/new_value are text; JSON/array casts and dates come back as strings and will render incorrectly in a naive diff view.Ramp-up
How can I help you explore Laravel packages today?