© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
dimasdario

How can I get the record created from a createOptionAction?

->createOptionAction(function (Action $action) {
    return $action
        ->modalHeading('Create new user')
        ->modalSubmitActionLabel('Create')
        ->modalWidth('lg')
        ->mutateFormDataUsing(function (array $data): array {
            $data['password'] = $data['document'];

            return $data;
        })
        ->after(function ($record) {
            dd($record); // returning null
        });
})
->createOptionAction(function (Action $action) {
    return $action
        ->modalHeading('Create new user')
        ->modalSubmitActionLabel('Create')
        ->modalWidth('lg')
        ->mutateFormDataUsing(function (array $data): array {
            $data['password'] = $data['document'];

            return $data;
        })
        ->after(function ($record) {
            dd($record); // returning null
        });
})


I'm trying to get the record created inside after(), but this record is null. What would be the correct way to obtain this record?
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

Success Notification for CreateOptionAction with injected created Record
FilamentFFilament / ❓┊help
2y ago
How can I get the created model from createOptionForm?
FilamentFFilament / ❓┊help
2y ago
Testing - get created record
FilamentFFilament / ❓┊help
2y ago