laravel-revisionable icon indicating copy to clipboard operation
laravel-revisionable copied to clipboard

Add more examples

Open nekromoff opened this issue 7 years ago • 4 comments

E.g. it is not clear how to undo deletion

I can see the change (deletion) saved in revisions table, but how do I roll it back?

nekromoff avatar Jan 03 '18 19:01 nekromoff

Hey there.. You can simply "rollback" to any revision you like and then save again in order to create a new "point in the timeline".

Consider the following example: You are currently at version 9 of an Address object. The user then rolls back to any previous version (e.g., lets say, he rolls back to version 4). You (as a developer) may not immediately save this version back to the database (this is now version 10, with the "content" of version 4).

You know, what i mean? Cheers

johannesschobel avatar Jan 04 '18 10:01 johannesschobel

This I understand now. However, no rollback is possible once the model has been destroyed (after delete/destroy). I think it would be great if this would be also possible.

On Thu, Jan 4, 2018 at 11:12 AM, Johannes Schobel [email protected] wrote:

Hey there.. You can simply "rollback" to any revision you like and then save again in order to create a new "point in the timeline".

Consider the following example: You are currently at version 9 of an Address object. The user then rolls back to any previous version (e.g., lets say, he rolls back to version 4). You (as a developer) may not immediately save this version back to the database (this is now version 10, with the "content" of version 4).

You know, what i mean? Cheers

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johannesschobel/laravel-revisionable/issues/9#issuecomment-355245393, or mute the thread https://github.com/notifications/unsubscribe-auth/AIJ3zQ2Qy2bjkfOJOg1Xs5gtC9XfPb5Uks5tHKQmgaJpZM4RSL5G .

nekromoff avatar Jan 04 '18 10:01 nekromoff

You need to enable SoftDeletes()

johannesschobel avatar Jan 04 '18 10:01 johannesschobel

OK, cool, thanks.

On Thu, Jan 4, 2018 at 11:39 AM, Johannes Schobel [email protected] wrote:

You need to enable SoftDeletes()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johannesschobel/laravel-revisionable/issues/9#issuecomment-355250747, or mute the thread https://github.com/notifications/unsubscribe-auth/AIJ3zdMBXn23RP3tuuKffA6J2vqxNeU2ks5tHKpGgaJpZM4RSL5G .

nekromoff avatar Jan 04 '18 10:01 nekromoff