© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
MarconiMamba

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.
Activity Log by Dennis Koch - Filament
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.
filament-activity-log/src/Pages/ListActivities.php at 3247e25b84e6e...
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Set default value to a select, listening the change from another input
FilamentFFilament / ❓┊help
3y ago
Set value of another field from within default
FilamentFFilament / ❓┊help
3y ago
Setting a default value for hidden fields
FilamentFFilament / ❓┊help
3y ago
Setting the default value of a TextInput within a Repeater
FilamentFFilament / ❓┊help
2y ago