Action::make('editTutor')
->label('Editar tutor/a')
->iconButton()
->icon('heroicon-o-pencil')
->modal()
->mountUsing(function (ComponentContainer $form, Tutor $record) {
return [
$form->fill([
'name' => $record->name,
'1st_surname' => $record['1st_surname'],
'2nd_surname' => $record['2nd_surname'],
'gender' => $record->gender,
'birthdate' => $record->birthdate,
'birth_city' => $record->birth_city,
'id_card_type' => $record->id_card_type,
'id_card' => $record->id_card,
'email' => $record->email,
'profession' => $record->profession,
'private_phone' => $record->private_phone,
'emergency_phone' => $record->emergency_phone,
'address' => $record->address,
'postal_code' => $record->postal_code,
'city' => $record->city,
'id_card_file' => $record->id_card_file,
]),
];
})
->form(EditForm::getSchema())
->after(function ($data, $record) {
$record->fill($data);
...
})