Support the ongoing development of Laravel.io →
posted 10 years ago
Packages
Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

I have a project where I need an audit trail of all edits - I have a base model that writes to an audit table with the old/new values json encoded

Note this isn't used for rollbacks etc, but purely to audit who made what changes

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.