© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
3 replies
hootch

Fill form in CreateAction

i have Offices and Members,
if a member is created from an already existing office office_id should be forced (pre-filled)
i created a MembersRelationManager that extends RelationManager, i have MembersTable with headerActions:
CreateAction::make()
    ->label('Create New Member')
    ->successNotificationTitle('Member created successfully')
    ->mutateDataUsing(function (array $data): array {
        $data['office_id'] = $this->getOwnerRecord()->id;
        return $data;
    }),
CreateAction::make()
    ->label('Create New Member')
    ->successNotificationTitle('Member created successfully')
    ->mutateDataUsing(function (array $data): array {
        $data['office_id'] = $this->getOwnerRecord()->id;
        return $data;
    }),

mutateDataUsing is setting the office_id after creating and before inserting to DB,
but what i want is to fill the form with office_id initially,
is there any way to pre-fill the form, or set data somewhere so it can reflect into the form?

PS: EditAction in the other hand has mutateRecordDataUsing which does the job
EditAction::make()
    ->slideOver()
    ->successNotificationTitle('Member updated successfully')
    ->mutateRecordDataUsing(function (array $data): array {
        $data['office_id'] = $this->getOwnerRecord()->id;

        return $data;
    }),
EditAction::make()
    ->slideOver()
    ->successNotificationTitle('Member updated successfully')
    ->mutateRecordDataUsing(function (array $data): array {
        $data['office_id'] = $this->getOwnerRecord()->id;

        return $data;
    }),
Solution
You use use the
->fillForm()
->fillForm()
method on the
CreateAction
CreateAction
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

createAction inside form section
FilamentFFilament / ❓┊help
3y ago
Fill Form Data
FilamentFFilament / ❓┊help
3y ago
Partial Form fill?
FilamentFFilament / ❓┊help
3y ago
Fill form after mount in v3?
FilamentFFilament / ❓┊help
3y ago