© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
11 replies
Adysone

Update section heading programmatically

Hello,

Is it possible to update a section heading programmatically? Or display a form field in it?

I would like to display a "total cost" calculated with other fields of the form, in the heading of a section.

The issue is that I put a value in the heading like so:

Forms\Components\Section::make()
    ->heading(fn(Get $get): string => (string) $get('total_cost'))
Forms\Components\Section::make()
    ->heading(fn(Get $get): string => (string) $get('total_cost'))


But my "total_cost" field is not defined on a creation form, because it's calculated after some fields are updated.

How can I force the update of the heading? IS there a "boot" method on form builder?
Solution
I finally did what I wanted by calling my "calculateTotalCost" in the heading() closure 👍
Jump to solution
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

Section Heading-Background-Color
FilamentFFilament / ❓┊help
2y ago
Toggle in section heading
FilamentFFilament / ❓┊help
2y ago
Section heading text color
FilamentFFilament / ❓┊help
3y ago
Update Modal Heading
FilamentFFilament / ❓┊help
3y ago