dimasdario
dimasdario
FFilament
Created by dimasdario on 6/3/2024 in #❓┊help
How can I get the record created from a createOptionAction?
->createOptionAction(function (Action $action) {
return $action
->modalHeading('Create new user')
->modalSubmitActionLabel('Create')
->modalWidth('lg')
->mutateFormDataUsing(function (array $data): array {
$data['password'] = $data['document'];

return $data;
})
->after(function ($record) {
dd($record); // returning null
});
})
->createOptionAction(function (Action $action) {
return $action
->modalHeading('Create new user')
->modalSubmitActionLabel('Create')
->modalWidth('lg')
->mutateFormDataUsing(function (array $data): array {
$data['password'] = $data['document'];

return $data;
})
->after(function ($record) {
dd($record); // returning null
});
})
I'm trying to get the record created inside after(), but this record is null. What would be the correct way to obtain this record?
4 replies