Custom value for field (fill and save field with custom table column)

Hello, I would like to make a form in which there would be 2 fields: 1 date field (day, month, year) and 1 time field (hour, minute). I would like to have these 2 data stored in a single datetime field in my table. How can I use "virtual values" for some fields? I also need these fields to retrieve these values by decomposing the datetime.
4 Replies
Dennis Koch
Dennis Koch2y ago
Virtual columns are a Database feature. You can either use these or the mutation methods Filament provides
Zeldroxe
ZeldroxeOP2y ago
Thank you for your reply. I'm not talking about virtual columns but about a field on a form that has no direct link to the database table. The aim is simply to make it easier for the user to use. What is the mutation method for "Select" fields to set the value? I could not find the information in the documentation.
Zeldroxe
ZeldroxeOP2y ago
This is exactly what I was looking for. Thank you so much! Is it possible to mutate field that is in a relation repeater ? Like "activities.record-1.start_time" ? I just found it, it's good. For those who are looking for this, you have to use the mutateRelationshipDataBeforeFillUsing() function on the repeater field.
Want results from more Discord servers?
Add your server