encrypt the database hosts password

This commit is contained in:
notCharles 2024-05-10 16:15:10 -04:00
parent dfe2e9d629
commit 9f4bf8777e
2 changed files with 19 additions and 0 deletions

View File

@ -62,5 +62,15 @@ class CreateDatabaseHost extends CreateRecord
'lg' => 2,
]),
]);
}
protected function mutateFormDataBeforeSave(array $data): array
{
if (isset($data['password'])) {
$data['password'] = encrypt($data['password']);
}
return $data;
}
}

View File

@ -65,4 +65,13 @@ class EditDatabaseHost extends EditRecord
Actions\DeleteAction::make(),
];
}
protected function mutateFormDataBeforeSave(array $data): array
{
if (isset($data['password'])) {
$data['password'] = encrypt($data['password']);
}
return $data;
}
}