How to add a sum of related fields in Form/Components/section

So I have a side panel next to my Leads form,

                Forms\Components\Section::make()->schema([
                    Forms\Components\Placeholder::make('created_at')
                    ->label('Created at')
                    ->content(fn (Lead $record): ?string => $record->created_at?->diffForHumans()),

                    Forms\Components\Placeholder::make('updated_at')
                    ->label('Last modified at')
                    ->content(fn (Lead $record): ?string => $record->updated_at?->diffForHumans()),

                    // sum of related services
                ])


The Lead resource hasMany Services.
I would like to summarise the value of all these services by 'price' in the side panel next to my lead form.

Is this possible and if so, what should I be looking at to figure this out?

Appreciate the help!
image.png
Was this page helpful?