framework icon indicating copy to clipboard operation
framework copied to clipboard

[Request] Version control on Eloquent models

Open alexdover opened this issue 12 years ago • 2 comments

This might be something which is considered a step too far for Eloquent and should instead remain as part of the application logic, but I thought I would raise it as a potential feature for the future.

I am currently building an application where the user can edit certain models, for example a Page. They can choose to publish the page, which in my application then sets this to have a status of published (one of the attributes) and the page is then viewable. If the user returns to edit the page, I then create a second record in the database, with an incremented version number and a status of draft. The user can then edit this draft without impacting on the live version at all. When they are happy, this version is published and the status of the previously published version is set to archived.

In the same way as Eloquent manages the timestamps, soft deleting and relationships I wonder if it might be possible to expand its scope to cover version control?

alexdover avatar Jan 10 '14 16:01 alexdover

Feel free to make a package for it.

taylorotwell avatar Jan 10 '14 16:01 taylorotwell

OK cool, thanks for your response. I will give it a go.

alexdover avatar Jan 10 '14 16:01 alexdover