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.
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
Add a Filament page that nicely shows your spatie/laravel-activitylog.

GitHub
Spatie activity log integration into Filament. Contribute to pxlrbt/filament-activity-log development by creating an account on GitHub.