Merge branch 'master' of https://github.com/brkcvn/akaunting into code-clean

This commit is contained in:
Burak Civan
2022-08-24 09:29:14 +03:00
2 changed files with 9 additions and 3 deletions

View File

@ -34,11 +34,16 @@ class Profile extends FormRequest
. ',deleted_at,NULL';
}
$change_password = $this->request->get('change_password') == true || $this->request->get('change_password') != null;
$current_password = $change_password ? '|current_password' : '';
$password = $change_password ? '|confirmed' : '';
return [
'name' => 'required|string',
'email' => $email,
'current_password' => 'required_if:change_password,true|current_password',
'password' => 'required_if:change_password,true|confirmed',
'current_password' => 'required_if:change_password,true' . $current_password,
'password' => 'required_if:change_password,true' . $password,
'picture' => $picture,
];
}