© 2026 Hedgehog Software, LLC

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

getFormActions / getCreateFormAction - Need to customize the save button to add more functionality

I have a resource in which I need to change the SAVE button by a new one which saves and also adds some function that I have prepared.

How can I achieve this, please?

I have tried adding this function to the CreateResource.php:

protected function getFormActions(): array
{
    return [
       $this->getCreateFormAction()->label('Crear traspaso contable')->color('primary'),
    ];
}
protected function getFormActions(): array
{
    return [
       $this->getCreateFormAction()->label('Crear traspaso contable')->color('primary'),
    ];
}


But I do not know how to:
- Add my special function to that button (I want it to add the record to the table and do other things as well)

Any ideas, please?

I have also tried using an observer, which works fine, but then the problem is knowing how to:
- change or delete the notification typical message of "created", because my other function also gives a message and one is shown covering the other.

Tks.
Solution
have you checked the Customizing the creation process in the docs? https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-the-creation-process
also check the Lifecycle hooks in that same page.
If that doesn't cover you needs, then you need to create a Laravel Action, not a Filament action, there you will handle everything about your saving process and then maybe remove the default save button and replace it with your own, so that it invokes your action. Does this help?
Creating records - Panel Builder - Filament
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

how to customize save button
FilamentFFilament / ❓┊help
3y ago
Button Save and add
FilamentFFilament / ❓┊help
3y ago
Customize button
FilamentFFilament / ❓┊help
3y ago
Repeater: Position "Add more" button
FilamentFFilament / ❓┊help
3y ago