© 2026 Hedgehog Software, LLC

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

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
                ])
                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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to add a button inside a section in form?
FilamentFFilament / ❓┊help
16mo ago
add actions to form section
FilamentFFilament / ❓┊help
3y ago
It's possible to add actions in a section of a form?
FilamentFFilament / ❓┊help
3y ago
Summary Sum() of 2 fields
FilamentFFilament / ❓┊help
3y ago