Action after "Create"
We have button Create in the form. And i wanna do some action after create. How i can do that.
9 Replies
->afterCreate()
hook? 🤔but where excaly i should use this hook
On the Action
It's just
->after()
. Look at the docs:
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#lifecycle-hooksthx
class CreateSending extends CreateRecord
{
protected static string $resource = SendingResource::class;
protected function getCreateFormAction(): \Filament\Actions\Action
{
return parent::getCreateFormAction()->mutateFormDataUsing(function (array $data): array {
$data['title'] = 'mama';
return $data;
});
}
i did like that. I fell like i did it wrong
it doesnt changing data idk why
thank u so much. i love u