I have a couple of cases where I do this - typically I just soft-delete the old record and insert the new one (the trade-off being that you can't use composite keys in this way). If I want a full revision history I add
withTrashed() to the query.
I suppose a package that adds a pre-update hook to do this could work?
I believe WordPress stores a row for each of the revisions, and uses a column to specify whether or not each row is a revision or the most current (active) post.
This would be very easy to implement in Laravel with scopes.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us