Setting a default value to another value from the table.

I'm building a form in a relationManager and I am building a sort of version control where users can't directly edit an existing item, but they have to create a new one. I would like the 'content' field in the new item to default to the 'content' field of the most recent field (under the same parent model) so they can just make their changes and save, but then delete models to rollback to a certain version. I'm having trouble scoping out how to get that default value. (unless somebody has a better suggestion for versioning data like this)
Solution:
Another idea: The https://filamentphp.com/plugins/pxlrbt-activity-log plugin by Dennis Koch uses the Spatie Activity Log package to track changes to model data. It has a rollback/"restore" feature to handle versioned models: https://github.com/pxlrbt/filament-activity-log/blob/3247e25b84e6ebd8ed765dfd15a4698e1c45f2d2/src/Pages/ListActivities.php#L85-L120 See the #pxlrbt-activity-log channel for more on the plugin....
Filament
Activity Log by Dennis Koch - Filament
Add a Filament page that nicely shows your spatie/laravel-activitylog.
GitHub
filament-activity-log/src/Pages/ListActivities.php at 3247e25b84e6e...
Spatie activity log integration into Filament. Contribute to pxlrbt/filament-activity-log development by creating an account on GitHub.
Jump to solution
2 Replies
Solution
DrByte
DrByte14mo ago
Another idea: The https://filamentphp.com/plugins/pxlrbt-activity-log plugin by Dennis Koch uses the Spatie Activity Log package to track changes to model data. It has a rollback/"restore" feature to handle versioned models: https://github.com/pxlrbt/filament-activity-log/blob/3247e25b84e6ebd8ed765dfd15a4698e1c45f2d2/src/Pages/ListActivities.php#L85-L120 See the #pxlrbt-activity-log channel for more on the plugin.
Filament
Activity Log by Dennis Koch - Filament
Add a Filament page that nicely shows your spatie/laravel-activitylog.
GitHub
filament-activity-log/src/Pages/ListActivities.php at 3247e25b84e6e...
Spatie activity log integration into Filament. Contribute to pxlrbt/filament-activity-log development by creating an account on GitHub.
MarconiMamba
MarconiMambaOP14mo ago
I tried installing that plugin before and got errors I didn't feel like troubleshooting at the time. it doesn't seem to work with my json require having filament requiring 3.0-stable
Want results from more Discord servers?
Add your server