now login is using username not email

This commit is contained in:
Geriano
2022-07-16 01:13:45 +07:00
parent 12f7a74e10
commit 0a92d68068
9 changed files with 35 additions and 20 deletions

View File

@@ -21,6 +21,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'username' => ['required', 'max:255', Rule::unique('users')->ignore($user->id)],
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
])->validateWithBag('updateProfileInformation');
@@ -33,8 +34,9 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
$this->updateVerifiedUser($user, $input);
} else {
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
'name' => mb_strtolower($input['name']),
'email' => mb_strtolower($input['email']),
'username' => mb_strtolower($input['username']),
])->save();
}
}