Widgets
Hi, I have a list of data. Each list of data has also data (hasMany). I used filament relation manager to do this.
Is is possible to attach a widget (like the sum, avg, and total) on top of the relation manager? How?
2 Replies
I don't think there's a built in way like there is on resources, but you could probably use the 'panels::resource.relation-manager.before' render hook to do it.
Although tbh I don't exactly know how you would figure out what the owner record is in order to restrict your stats queries. Maybe someone else can figure that out. Maybe $this->ownerRecord would magically be in scope from the RM in your view.
https://filamentphp.com/docs/3.x/support/render-hooks
Thanks @Hugh Messenger that's possible but I ended using
summarize
π