how do i sum a column across all rows of a repeater from a function in the Resource?
I can't glean this from the docs. I would like to loop through all rows of my repeater field and sum a field named "amount". Hos do I go about it?
3 Replies
did you find a way to do it?
Please share the code of what you are trying to do.
thanks @awcodes, don't know if @Ayz could do it (sorry for tag you both directly) but I was able to do it with this video -> https://www.youtube.com/watch?v=6bhF70zZsOM it's exactly what I was looking for
Filament Daily
YouTube
Filament: Repeater "Live" Form Changes with afterStateUpdated()
Example of Invoice items and calculating the total, with Repeater field and a custom function.
Original tutorial: https://laraveldaily.com/post/filament-repeater-live-calculations-on-update
Full project: https://filamentexamples.com/project/invoice-editor-items