© 2026 Hedgehog Software, LLC

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

Why mutateFormDataBeforeCreate() doesn't work

protected function mutateFormDataBeforeCreate(array $data): array
{
$private = RSA::createKey(2048);
$data['private_key'] = (string)$private;
$data['public_key'] = (string)$private->getPublicKey();
//ddd($data);
return $data;
}
After I click the button 'create', I found that the field 'private_key' 'public_key' in the newest record is still null. However, the ddd($data) works when I uncommented it.
Solution
Maybe they are not in the $fillable array of the Model?
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

Why doesn't model injection work for ActionGroup?
FilamentFFilament / ❓┊help
3y ago
afterStateUpdated doesn't work
FilamentFFilament / ❓┊help
2y ago
ExportBulkAction doesn't work
FilamentFFilament / ❓┊help
2y ago
afterStateHydrated() doesn't work?
FilamentFFilament / ❓┊help
3y ago