© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
Albert Lens

Mutate Data before Create (calculated column)

Hello.
I need to calculate a column with series & id.
The fields are Id, Series, NumExp and I need numExp to be equal to SERIES-ID

If series is ABC and id is 20, I need numExp to be ABC20

I have tried this mutateFormDataBeforeCreate but it is not working.
protected function mutateFormDataBeforeCreate(array $data): array
    {
        $data['numExp'] =  $data['serie'] . '-' . $data['id'];
        return $data;
    }
protected function mutateFormDataBeforeCreate(array $data): array
    {
        $data['numExp'] =  $data['serie'] . '-' . $data['id'];
        return $data;
    }


Is there a boot method in the Model or something, please?
Tks.
Solution
Finally I have created an Observer.

Thank you.
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

Mutate Before Create Function
FilamentFFilament / ❓┊help
3y ago
Mutate form data before create but for delete
FilamentFFilament / ❓┊help
3y ago
Mutate ManageRelatedRecords data before saving
FilamentFFilament / ❓┊help
2y ago
mutate relation data before saving
FilamentFFilament / ❓┊help
3y ago