Laravel-Backpack / revise-operation

An admin interface for venturecraft/revisionable - audit log for your Eloquent entries.
Other
42 stars 10 forks source link

[Bug] Revise Operation doesn't show revisions of relations #11

Closed akshay-ajackus closed 3 years ago

akshay-ajackus commented 3 years ago

I am using backpacker for admin panel in my project. I m using revise-operation for tracking history of CRUD operations. The problem is that in revise blade foreign table history is not showing but it is getting updated in database.

Table Structure -

Company - id, name, address, etc.

CompanyParameterValues - id, company_id, value, text, etc.

Here Company has many parameters and CompanyParameterValue belongTo one Company. I want to show CompanyParameterValue edit history in Company revision blade.

Thanks in Advance.

welcome[bot] commented 3 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

promatik commented 3 years ago

Hi @akshay-ajackus revisionable only stores the changes of the model your in, not it's relationships.

In your case CompanyParameterValue is another Model.

My suggestion to accomplish this is to use RevisionableTrait on CompanyParameterValue model to log the revisions for that too. Then override listRevisions (from Backpack\ReviseOperation\ReviseOperation) method on your Company model in a way you'll display changes from both models.

Please let us know if you've figure out a way to solve this 🙌