© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
bionary

Additional Info Fields in Form

What is the best way to go about adding supplemental data fields to a form? But the catch is, it shouldn't be handled as form fields. (not saved)
I often find that including stuff like parent-relationship info in or near the form is helpful sometimes.

I tried using
ViewField
ViewField
and making sure that my view had non-form elements in it, but when upon saving the form, filament is expecting a saved data field for "parent_properties" as setup below.

ViewField::make('parent_properties')->view('filament.forms.components.text-display')
ViewField::make('parent_properties')->view('filament.forms.components.text-display')

//text-display.blade.php
<x-dynamic-component
        :component="$getFieldWrapperView()"
        :id="$getId()"
        :label="$getLabel()"
        :label-sr-only="$isLabelHidden()"
        :helper-text="$getHelperText()"
        :hint="$getHint()"
        :hint-action="$getHintAction()"
        :hint-color="$getHintColor()"
        :hint-icon="$getHintIcon()"
        :required="$isRequired()"
        :state-path="$getStatePath()"
>

    <p>Project: {{$this->record->article->project->name}}</p>
    <p>Category: {{$this->record->article->category->path}}</p>
    <p>Article: {{$this->record->article->title}}</p>
    <p>Contractor: {{$this->record->contractor->name}}</p>
</x-dynamic-component>
//text-display.blade.php
<x-dynamic-component
        :component="$getFieldWrapperView()"
        :id="$getId()"
        :label="$getLabel()"
        :label-sr-only="$isLabelHidden()"
        :helper-text="$getHelperText()"
        :hint="$getHint()"
        :hint-action="$getHintAction()"
        :hint-color="$getHintColor()"
        :hint-icon="$getHintIcon()"
        :required="$isRequired()"
        :state-path="$getStatePath()"
>

    <p>Project: {{$this->record->article->project->name}}</p>
    <p>Category: {{$this->record->article->category->path}}</p>
    <p>Article: {{$this->record->article->title}}</p>
    <p>Contractor: {{$this->record->contractor->name}}</p>
</x-dynamic-component>


I know I can use one of the mutateData...functions to strip the form input prior to being saved, but I can see this getting sloppy and bloated quickly. What is a better approach? Thanks!
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

Validating additional fields inside a custom form field
FilamentFFilament / ❓┊help
3y ago
Computed state in form fields.
FilamentFFilament / ❓┊help
15mo ago
Calculated fields in form builder
FilamentFFilament / ❓┊help
3y ago
Filament Form: Dynamic additional_fields values not being saved properly
FilamentFFilament / ❓┊help
12mo ago