I didn't face that use case before, but here's how I would do it.
-
Create a database table similar to the model that I want to save with an extra
saved_attimestamp field. But solution will work if I have only one model. -
Store the model values as a JSON with morph relationship in a separated table. But then we need to keep converting it to a model again after retrieving the JSON data.
-
Duplicate the row inside the same table with a
parent_idmarking the origin record, and when we need to retirve the most updated one we usesaved_atto get last saved item.
Just thinking with you loudly.