How to get the current record in lifecycle hook after() method on pop up

I'm having a issue in getting the current record in the after() method of a pop up, I thought to be able to access the current record with $this->record like in the afterCreate() method but it keeps returning null on $this->record. I can only acces the form data which of curseare not including the id of the current record that I need. Any suggestion on how to do so? Thank you in advance
5 Replies
Dan Harrin
Dan Harrin2y ago
which action is it, CreateAction ? did you try function ($record) {}
Gianmarco Varrone
Hey. Thanks for the reply Following the code I'm trying : Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) { if($data["is_recursive"]){ $data["status"] = "ongoing"; }else{ $data["status"] = "created"; } return $data; })->after(function(array $data, $record){ dd($record); RevolutPayment::create(); }), the dd() keeps returning null, while $data has the form data I also tried $this->record same null
Dan Harrin
Dan Harrin2y ago
are you on the latest filament version
Gianmarco Varrone
yes
Dan Harrin
Dan Harrin2y ago
please open an issue with a reproduction repository
Want results from more Discord servers?
Add your server