HeyWeb
Resource page that can share the same Model
->actions([
Tables\Actions\EditAction::make()->mutateFormDataUsing(function (array $data): array {
$resource = $this->getResource();
$record = $resource->getCurrentRecord();
// Create a new MedicalRecord instance
$medicalRecord = new MedicalRecord();
// Set the user_id and medical_request_id for the MedicalRecord
$medicalRecord->user_id = $record->user_id;
$medicalRecord->medical_request_id = $record->id;
// Save the MedicalRecord instance
$medicalRecord->save();
}),
30 replies