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
which action is it, CreateAction ?
did you try
function ($record) {}
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 nullare you on the latest filament version
yes
please open an issue with a reproduction repository